Class: SirenClient::RawResponse
- Inherits:
-
Object
- Object
- SirenClient::RawResponse
- Defined in:
- lib/siren_client/raw_response.rb
Instance Attribute Summary collapse
-
#response ⇒ Object
Returns the value of attribute response.
Instance Method Summary collapse
- #body ⇒ Object
- #code ⇒ Object
- #headers ⇒ Object
-
#initialize(http_res) ⇒ RawResponse
constructor
A new instance of RawResponse.
- #message ⇒ Object
- #parsed_response ⇒ Object
Constructor Details
#initialize(http_res) ⇒ RawResponse
Returns a new instance of RawResponse.
5 6 7 8 9 10 |
# File 'lib/siren_client/raw_response.rb', line 5 def initialize(http_res) unless http_res.class == HTTParty::Response raise InvalidResponseError, "SirenClient::RawResponse expects a HTTParty::Response instance." end @response = http_res end |
Instance Attribute Details
#response ⇒ Object
Returns the value of attribute response.
3 4 5 |
# File 'lib/siren_client/raw_response.rb', line 3 def response @response end |
Instance Method Details
#body ⇒ Object
16 17 18 |
# File 'lib/siren_client/raw_response.rb', line 16 def body @response.body end |
#code ⇒ Object
20 21 22 |
# File 'lib/siren_client/raw_response.rb', line 20 def code @response.code end |
#headers ⇒ Object
28 29 30 |
# File 'lib/siren_client/raw_response.rb', line 28 def headers @response.headers end |
#message ⇒ Object
24 25 26 |
# File 'lib/siren_client/raw_response.rb', line 24 def @response..strip end |
#parsed_response ⇒ Object
12 13 14 |
# File 'lib/siren_client/raw_response.rb', line 12 def parsed_response @response.parsed_response end |