This commit is contained in:
Mark Maglana
2013-09-10 01:31:25 -07:00
parent 0c32d078ac
commit 36a8efe542

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