Class: HTTParty::Response
- Inherits:
-
Object
- Object
- HTTParty::Response
- Defined in:
- lib/client.rb
Instance Method Summary collapse
Instance Method Details
#json ⇒ Object
25 26 27 |
# File 'lib/client.rb', line 25 def json ::JSON.parse(self.body) end |
#struct ⇒ Object
29 30 31 32 33 34 35 36 |
# File 'lib/client.rb', line 29 def struct case json when ::Array json.map{|o| ::RecursiveOpenStruct.new o, recurse_over_arrays: true } when ::Hash ::RecursiveOpenStruct.new json, recurse_over_arrays: true end end |