Class: Infurarb::Response
- Inherits:
-
Object
- Object
- Infurarb::Response
- Defined in:
- lib/infurarb/response.rb
Instance Attribute Summary collapse
-
#http_response ⇒ Object
readonly
Returns the value of attribute http_response.
-
#request ⇒ Object
readonly
Returns the value of attribute request.
Instance Method Summary collapse
- #body ⇒ Object
-
#initialize(http_response, request) ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize(http_response, request) ⇒ Response
Returns a new instance of Response.
4 5 6 7 |
# File 'lib/infurarb/response.rb', line 4 def initialize(http_response, request) @http_response = http_response @request = request end |
Instance Attribute Details
#http_response ⇒ Object (readonly)
Returns the value of attribute http_response.
3 4 5 |
# File 'lib/infurarb/response.rb', line 3 def http_response @http_response end |
#request ⇒ Object (readonly)
Returns the value of attribute request.
3 4 5 |
# File 'lib/infurarb/response.rb', line 3 def request @request end |
Instance Method Details
#body ⇒ Object
9 10 11 |
# File 'lib/infurarb/response.rb', line 9 def body @body ||= JSON.parse(http_response.body.readpartial) end |