Class: Tmdby::Response
- Inherits:
-
Object
- Object
- Tmdby::Response
- Defined in:
- lib/tmdby/response.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#http_verb ⇒ Object
readonly
Returns the value of attribute http_verb.
-
#post_params ⇒ Object
readonly
Returns the value of attribute post_params.
-
#raw_body ⇒ Object
readonly
Returns the value of attribute raw_body.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
-
#initialize(response, uri, http_verb, post_params) ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize(response, uri, http_verb, post_params) ⇒ Response
Returns a new instance of Response.
7 8 9 10 11 12 13 14 15 |
# File 'lib/tmdby/response.rb', line 7 def initialize(response, uri, http_verb, post_params) @code = response.code @headers = response.to_hash @raw_body = response.body @body = JSON.parse(response.body) @uri = uri @http_verb = http_verb.upcase @post_params = post_params end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
5 6 7 |
# File 'lib/tmdby/response.rb', line 5 def body @body end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
5 6 7 |
# File 'lib/tmdby/response.rb', line 5 def code @code end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
5 6 7 |
# File 'lib/tmdby/response.rb', line 5 def headers @headers end |
#http_verb ⇒ Object (readonly)
Returns the value of attribute http_verb.
5 6 7 |
# File 'lib/tmdby/response.rb', line 5 def http_verb @http_verb end |
#post_params ⇒ Object (readonly)
Returns the value of attribute post_params.
5 6 7 |
# File 'lib/tmdby/response.rb', line 5 def post_params @post_params end |
#raw_body ⇒ Object (readonly)
Returns the value of attribute raw_body.
5 6 7 |
# File 'lib/tmdby/response.rb', line 5 def raw_body @raw_body end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
5 6 7 |
# File 'lib/tmdby/response.rb', line 5 def uri @uri end |