Class: CurrencyCloud::ResponseHandler
- Inherits:
-
Object
- Object
- CurrencyCloud::ResponseHandler
- Defined in:
- lib/currency_cloud/response_handler.rb
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
-
#route ⇒ Object
readonly
Returns the value of attribute route.
-
#verb ⇒ Object
readonly
Returns the value of attribute verb.
Instance Method Summary collapse
-
#initialize(verb, route, params, response) ⇒ ResponseHandler
constructor
A new instance of ResponseHandler.
- #process ⇒ Object
Constructor Details
#initialize(verb, route, params, response) ⇒ ResponseHandler
Returns a new instance of ResponseHandler.
5 6 7 8 9 10 |
# File 'lib/currency_cloud/response_handler.rb', line 5 def initialize(verb, route, params, response) @verb = verb @route = route @params = params @response = response end |
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
3 4 5 |
# File 'lib/currency_cloud/response_handler.rb', line 3 def params @params end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
3 4 5 |
# File 'lib/currency_cloud/response_handler.rb', line 3 def response @response end |
#route ⇒ Object (readonly)
Returns the value of attribute route.
3 4 5 |
# File 'lib/currency_cloud/response_handler.rb', line 3 def route @route end |
#verb ⇒ Object (readonly)
Returns the value of attribute verb.
3 4 5 |
# File 'lib/currency_cloud/response_handler.rb', line 3 def verb @verb end |
Instance Method Details
#process ⇒ Object
12 13 14 15 |
# File 'lib/currency_cloud/response_handler.rb', line 12 def process return parsed_response if success? handle_failure end |