Class: Hithorizons::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/hithorizons/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#responseObject (readonly)

Returns the value of attribute response.



5
6
7
# File 'lib/hithorizons/response.rb', line 5

def response
  @response
end

Instance Method Details

#errorObject



15
16
17
# File 'lib/hithorizons/response.rb', line 15

def error
  response['Error']
end

#resultObject



19
20
21
# File 'lib/hithorizons/response.rb', line 19

def result
  response['Result']
end

#resultsObject



23
24
25
# File 'lib/hithorizons/response.rb', line 23

def results
  response.dig('Result', 'Results')
end

#results_countObject



31
32
33
# File 'lib/hithorizons/response.rb', line 31

def results_count
  response.dig('Result', 'ResultsCount')
end

#successObject



11
12
13
# File 'lib/hithorizons/response.rb', line 11

def success
  response['Success']
end

#total_countObject



27
28
29
# File 'lib/hithorizons/response.rb', line 27

def total_count
  response.dig('Result', 'TotalCount')
end