Class: HTTParty::Response
- Inherits:
-
BlankSlate
- Object
- BlankSlate
- HTTParty::Response
- Defined in:
- lib/httparty/response.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#code ⇒ Object
Returns the value of attribute code.
-
#delegate ⇒ Object
readonly
Returns the value of attribute delegate.
-
#headers ⇒ Object
Returns the value of attribute headers.
Instance Method Summary collapse
-
#initialize(delegate, body, code, headers = {}) ⇒ Response
constructor
A new instance of Response.
- #method_missing(name, *args, &block) ⇒ Object
Constructor Details
#initialize(delegate, body, code, headers = {}) ⇒ Response
Returns a new instance of Response.
6 7 8 9 10 11 |
# File 'lib/httparty/response.rb', line 6 def initialize(delegate, body, code, headers={}) @delegate = delegate @body = body @code = code @headers = headers end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
13 14 15 |
# File 'lib/httparty/response.rb', line 13 def method_missing(name, *args, &block) @delegate.send(name, *args, &block) end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
3 4 5 |
# File 'lib/httparty/response.rb', line 3 def body @body end |
#code ⇒ Object
Returns the value of attribute code.
3 4 5 |
# File 'lib/httparty/response.rb', line 3 def code @code end |
#delegate ⇒ Object (readonly)
Returns the value of attribute delegate.
4 5 6 |
# File 'lib/httparty/response.rb', line 4 def delegate @delegate end |
#headers ⇒ Object
Returns the value of attribute headers.
3 4 5 |
# File 'lib/httparty/response.rb', line 3 def headers @headers end |