Merge pull request #31 from relaxdiego/fix/24

Fixes #24
This commit is contained in:
Mark Maglana
2013-09-10 01:34:21 -07:00

View File

@@ -2,12 +2,20 @@ module Aviator
class Response
def body
@body ||= if response.body.length > 0
JSON.parse(response.body).with_indifferent_access
else
{}
end
@body.dup
end
def method_missing(name, *args)
case name
when :body
@body ||= JSON.parse(response.body).with_indifferent_access
@body.dup
when :headers, :status
response.send(name)
when :request