Class: ResponseHandler
- Inherits:
-
Object
- Object
- ResponseHandler
- Defined in:
- lib/response_handler.rb
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
-
#single_from_list ⇒ Object
readonly
Returns the value of attribute single_from_list.
Instance Method Summary collapse
-
#initialize(response) ⇒ ResponseHandler
constructor
A new instance of ResponseHandler.
- #parse! ⇒ Object
Constructor Details
#initialize(response) ⇒ ResponseHandler
Returns a new instance of ResponseHandler.
3 4 5 |
# File 'lib/response_handler.rb', line 3 def initialize(response) @response = response end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
7 8 9 |
# File 'lib/response_handler.rb', line 7 def response @response end |
#single_from_list ⇒ Object (readonly)
Returns the value of attribute single_from_list.
7 8 9 |
# File 'lib/response_handler.rb', line 7 def single_from_list @single_from_list end |
Instance Method Details
#parse! ⇒ Object
9 10 11 |
# File 'lib/response_handler.rb', line 9 def parse! success? ? handle_success : handle_error end |