Class: TresDelta::Response
- Inherits:
-
Object
- Object
- TresDelta::Response
- Defined in:
- lib/tres_delta/response.rb
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(response) ⇒ Response
constructor
A new instance of Response.
- #method_missing(method, *args) ⇒ Object
- #success? ⇒ Boolean
Constructor Details
#initialize(response) ⇒ Response
Returns a new instance of Response.
5 6 7 |
# File 'lib/tres_delta/response.rb', line 5 def initialize(response) @response = response end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args) ⇒ Object
13 14 15 |
# File 'lib/tres_delta/response.rb', line 13 def method_missing(method, *args) @response[method] end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
3 4 5 |
# File 'lib/tres_delta/response.rb', line 3 def response @response end |
Class Method Details
.create_from_action(action, response) ⇒ Object
17 18 19 |
# File 'lib/tres_delta/response.rb', line 17 def self.create_from_action(action, response) self.new(response.body["#{action}_response".to_sym]["#{action}_result".to_sym]) end |
Instance Method Details
#success? ⇒ Boolean
9 10 11 |
# File 'lib/tres_delta/response.rb', line 9 def success? @response[:succeeded] end |