Class: Lapse::Transport::HTTP::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/lapse/transport/http.rb

Overview

Response class responsible for deserializing API calls

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(http_response, result_format = :mashie) ⇒ Response

Initializes a new result

Parameters:

  • http_response (Net::HTTPResponse)

    the raw response to parse



133
134
135
136
137
# File 'lib/lapse/transport/http.rb', line 133

def initialize(http_response, result_format = :mashie)
  @result_format = result_format
  @headers = parse_headers(http_response.to_hash)
  @body = parse_body(http_response.body)
end

Instance Attribute Details

#bodyObject

The parsed response

Returns:

  • (Object)

    the current value of body



127
128
129
# File 'lib/lapse/transport/http.rb', line 127

def body
  @body
end

#headersHash

HTTP headers returned as part of the response

Returns:

  • (Hash)

    the current value of headers



127
128
129
# File 'lib/lapse/transport/http.rb', line 127

def headers
  @headers
end