Class: Rentjuicer::Response
- Inherits:
-
Object
- Object
- Rentjuicer::Response
- Defined in:
- lib/rentjuicer/response.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
Instance Method Summary collapse
-
#initialize(response, raise_error = false) ⇒ Response
constructor
A new instance of Response.
- #method_missing(method_name, *args) ⇒ Object
- #success? ⇒ Boolean
Constructor Details
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/rentjuicer/response.rb', line 15 def method_missing(method_name, *args) if self.body.respond_to?(method_name) self.body.send(method_name) else super end end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
4 5 6 |
# File 'lib/rentjuicer/response.rb', line 4 def body @body end |
Instance Method Details
#success? ⇒ Boolean
11 12 13 |
# File 'lib/rentjuicer/response.rb', line 11 def success? self.body && !self.body.blank? && self.body.respond_to?(:status) && self.body.status == "ok" end |