class RestChain::RestResponse

Attributes

body[R]
headers[R]
status[R]

Public Class Methods

new(status, headers, body) click to toggle source
# File lib/rest_chain/rest_response.rb, line 5
def initialize(status, headers, body)
  @status  = status
  @headers = headers
  @body    = body
end

Public Instance Methods

json(options={}) click to toggle source
# File lib/rest_chain/rest_response.rb, line 16
def json(options={})
  JSON.parse(body, options)
end
success?() click to toggle source
# File lib/rest_chain/rest_response.rb, line 12
def success?
  (200..299).include?(@status)
end