Class: Totter::Transport::HTTP::Response
- Inherits:
-
Object
- Object
- Totter::Transport::HTTP::Response
- Defined in:
- lib/totter/transport/http.rb
Overview
Response class responsible for deserializing API calls
Instance Attribute Summary collapse
-
#body ⇒ Object
The parsed response.
-
#headers ⇒ Hash
HTTP headers returned as part of the response.
Instance Method Summary collapse
-
#initialize(http_response, result_format = :mashie) ⇒ Response
constructor
Initializes a new result.
Constructor Details
#initialize(http_response, result_format = :mashie) ⇒ Response
Initializes a new result
131 132 133 134 135 |
# File 'lib/totter/transport/http.rb', line 131 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
#body ⇒ Object
The parsed response
125 126 127 |
# File 'lib/totter/transport/http.rb', line 125 def body @body end |
#headers ⇒ Hash
HTTP headers returned as part of the response
125 126 127 |
# File 'lib/totter/transport/http.rb', line 125 def headers @headers end |