Class: Esputnik::Response
- Inherits:
-
Object
- Object
- Esputnik::Response
- Defined in:
- lib/esputnik/response.rb
Instance Method Summary collapse
-
#initialize(faraday_response) ⇒ Response
constructor
A new instance of Response.
- #json ⇒ Object
- #raw_body ⇒ Object
- #success? ⇒ Boolean
Constructor Details
#initialize(faraday_response) ⇒ Response
Returns a new instance of Response.
5 6 7 |
# File 'lib/esputnik/response.rb', line 5 def initialize(faraday_response) @raw_response = faraday_response end |
Instance Method Details
#json ⇒ Object
13 14 15 |
# File 'lib/esputnik/response.rb', line 13 def json JSON.parse(@raw_response.body) if @raw_response.body.present? end |
#raw_body ⇒ Object
17 18 19 |
# File 'lib/esputnik/response.rb', line 17 def raw_body @raw_response.body end |
#success? ⇒ Boolean
9 10 11 |
# File 'lib/esputnik/response.rb', line 9 def success? @raw_response.success? end |