I wonder if it possible to work with HTTParty request results as an object.
Currently I use string keys to access to values of result: result["imageurl"]
or result["address"]["street"]
If i were in JavaScript I could simply use: result.imageurl
or result.address.street
Use the Mash
class of the hashie gem.
tweet = Hashie::Mash.new(
HTTParty.get("http://api.twitter.com/1/statuses/public_timeline.json").first
)
tweet.user.screen_name
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With