Class: RedboothRuby::Request::Response
- Inherits:
-
Object
- Object
- RedboothRuby::Request::Response
- Defined in:
- lib/redbooth-ruby/request/response.rb
Overview
Wraps the API response parsing the json body and keeping interesting headers
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#data ⇒ Object
Returns the value of attribute data.
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#status ⇒ Object
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(attrs = {}) ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize(attrs = {}) ⇒ Response
Returns a new instance of Response.
8 9 10 11 12 13 |
# File 'lib/redbooth-ruby/request/response.rb', line 8 def initialize(attrs={}) @body = attrs[:body] @headers = attrs[:headers] @status = attrs[:status] initialize_data end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
6 7 8 |
# File 'lib/redbooth-ruby/request/response.rb', line 6 def body @body end |
#data ⇒ Object
Returns the value of attribute data.
6 7 8 |
# File 'lib/redbooth-ruby/request/response.rb', line 6 def data @data end |
#headers ⇒ Object
Returns the value of attribute headers.
6 7 8 |
# File 'lib/redbooth-ruby/request/response.rb', line 6 def headers @headers end |
#status ⇒ Object
Returns the value of attribute status.
6 7 8 |
# File 'lib/redbooth-ruby/request/response.rb', line 6 def status @status end |