Class: Takeout::Response
- Inherits:
-
Object
- Object
- Takeout::Response
- Defined in:
- lib/takeout/response.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#options ⇒ Object
Returns the value of attribute options.
-
#response ⇒ Object
Returns the value of attribute response.
Instance Method Summary collapse
- #extract_instance_variables_from_options(options) ⇒ Object
-
#initialize(options = {}) ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize(options = {}) ⇒ Response
Returns a new instance of Response.
8 9 10 11 12 13 14 |
# File 'lib/takeout/response.rb', line 8 def initialize(={}) if block_given? yield self else () end end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
4 5 6 |
# File 'lib/takeout/response.rb', line 4 def body @body end |
#headers ⇒ Object
Returns the value of attribute headers.
3 4 5 |
# File 'lib/takeout/response.rb', line 3 def headers @headers end |
#options ⇒ Object
Returns the value of attribute options.
6 7 8 |
# File 'lib/takeout/response.rb', line 6 def end |
#response ⇒ Object
Returns the value of attribute response.
5 6 7 |
# File 'lib/takeout/response.rb', line 5 def response @response end |
Instance Method Details
#extract_instance_variables_from_options(options) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/takeout/response.rb', line 16 def () # Set instance variables @headers = [:headers] || '' @body = [:body] || {} @response = [:response] || {} # Clean instance variables out of options hash and set that as options instance variable [:headers, :body, :response].each { |v| .delete(v) } = end |