Class: Jets::Api::Response
- Inherits:
-
Object
- Object
- Jets::Api::Response
- Defined in:
- lib/jets/api/response.rb
Instance Attribute Summary collapse
-
#http_body ⇒ Object
readonly
Returns the value of attribute http_body.
-
#http_headers ⇒ Object
readonly
Returns the value of attribute http_headers.
-
#http_resp ⇒ Object
readonly
Returns the value of attribute http_resp.
-
#http_status ⇒ Object
readonly
Returns the value of attribute http_status.
-
#request_id ⇒ Object
readonly
Returns the value of attribute request_id.
Instance Method Summary collapse
- #data ⇒ Object
-
#initialize(http_resp) ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize(http_resp) ⇒ Response
Returns a new instance of Response.
12 13 14 15 16 17 18 |
# File 'lib/jets/api/response.rb', line 12 def initialize(http_resp) @http_resp = http_resp @http_body = http_resp.body @http_headers = http_resp.to_hash @http_status = http_resp.code.to_i @request_id = http_resp["request-id"] end |
Instance Attribute Details
#http_body ⇒ Object (readonly)
Returns the value of attribute http_body.
5 6 7 |
# File 'lib/jets/api/response.rb', line 5 def http_body @http_body end |
#http_headers ⇒ Object (readonly)
Returns the value of attribute http_headers.
5 6 7 |
# File 'lib/jets/api/response.rb', line 5 def http_headers @http_headers end |
#http_resp ⇒ Object (readonly)
Returns the value of attribute http_resp.
5 6 7 |
# File 'lib/jets/api/response.rb', line 5 def http_resp @http_resp end |
#http_status ⇒ Object (readonly)
Returns the value of attribute http_status.
5 6 7 |
# File 'lib/jets/api/response.rb', line 5 def http_status @http_status end |
#request_id ⇒ Object (readonly)
Returns the value of attribute request_id.
5 6 7 |
# File 'lib/jets/api/response.rb', line 5 def request_id @request_id end |