class Apperol::Response
Attributes
headers[RW]
original_body[RW]
status[RW]
Public Class Methods
new(status, body, options = {})
click to toggle source
# File lib/apperol/response.rb, line 5 def initialize(status, body, options = {}) @status = status.to_i @original_body = body @headers = options[:headers] end
Public Instance Methods
[](key)
click to toggle source
# File lib/apperol/response.rb, line 19 def [](key) puts @headers @headers[key.downcase].first end
body()
click to toggle source
# File lib/apperol/response.rb, line 11 def body @body ||= JSON.parse(original_body) end
header(key)
click to toggle source
# File lib/apperol/response.rb, line 15 def header(key) @headers[key.downcase].first end