Class: Hithorizons::Response
- Inherits:
-
Object
- Object
- Hithorizons::Response
- Defined in:
- lib/hithorizons/response.rb
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
- #error ⇒ Object
-
#initialize(response) ⇒ Response
constructor
A new instance of Response.
- #result ⇒ Object
- #results ⇒ Object
- #results_count ⇒ Object
- #success ⇒ Object
- #total_count ⇒ Object
Constructor Details
#initialize(response) ⇒ Response
Returns a new instance of Response.
7 8 9 |
# File 'lib/hithorizons/response.rb', line 7 def initialize(response) @response = response end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
5 6 7 |
# File 'lib/hithorizons/response.rb', line 5 def response @response end |
Instance Method Details
#error ⇒ Object
15 16 17 |
# File 'lib/hithorizons/response.rb', line 15 def error response['Error'] end |
#result ⇒ Object
19 20 21 |
# File 'lib/hithorizons/response.rb', line 19 def result response['Result'] end |
#results ⇒ Object
23 24 25 |
# File 'lib/hithorizons/response.rb', line 23 def results response.dig('Result', 'Results') end |
#results_count ⇒ Object
31 32 33 |
# File 'lib/hithorizons/response.rb', line 31 def results_count response.dig('Result', 'ResultsCount') end |
#success ⇒ Object
11 12 13 |
# File 'lib/hithorizons/response.rb', line 11 def success response['Success'] end |
#total_count ⇒ Object
27 28 29 |
# File 'lib/hithorizons/response.rb', line 27 def total_count response.dig('Result', 'TotalCount') end |