Class: APICake::Payload
- Inherits:
-
Object
- Object
- APICake::Payload
- Defined in:
- lib/apicake/payload.rb
Instance Attribute Summary collapse
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#parsed_response ⇒ Object
readonly
Returns the value of attribute parsed_response.
-
#request ⇒ Object
readonly
Returns the value of attribute request.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(response) ⇒ Payload
constructor
A new instance of Payload.
- #to_h ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(response) ⇒ Payload
Returns a new instance of Payload.
5 6 7 8 9 10 |
# File 'lib/apicake/payload.rb', line 5 def initialize(response) @request = response.request @headers = response.headers @response = response.response @parsed_response = response.parsed_response end |
Instance Attribute Details
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
3 4 5 |
# File 'lib/apicake/payload.rb', line 3 def headers @headers end |
#parsed_response ⇒ Object (readonly)
Returns the value of attribute parsed_response.
3 4 5 |
# File 'lib/apicake/payload.rb', line 3 def parsed_response @parsed_response end |
#request ⇒ Object (readonly)
Returns the value of attribute request.
3 4 5 |
# File 'lib/apicake/payload.rb', line 3 def request @request end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
3 4 5 |
# File 'lib/apicake/payload.rb', line 3 def response @response end |
Instance Method Details
#to_h ⇒ Object
12 13 14 15 |
# File 'lib/apicake/payload.rb', line 12 def to_h { request: request, response: response, headers: headers, parsed_response: parsed_response } end |
#to_s ⇒ Object
17 18 19 |
# File 'lib/apicake/payload.rb', line 17 def to_s parsed_response.to_s end |