Class: BestMatchResponse
- Defined in:
- lib/dto/search/best_match_response.rb
Overview
Class BestMatchResponse represents server response on best_match
Search API request. Server response is sent to initializer which creates objects with attributes category
, numResults
accessible via getters:
-
category
-
num_results
-
numResults
Examples:
response = BestMatchResponse.new("category" => "VAUT", "numResults" => 20)
response.category # => "VAUT"
response.numResults # => 20
response.num_results # => 20
Instance Attribute Summary collapse
-
#category ⇒ Object
Returns the value of attribute category.
-
#error ⇒ Object
Returns the value of attribute error.
-
#numResults ⇒ Object
Returns the value of attribute numResults.
Instance Method Summary collapse
-
#initialize(hash = {}) ⇒ BestMatchResponse
constructor
A new instance of BestMatchResponse.
Methods inherited from Struct
Constructor Details
#initialize(hash = {}) ⇒ BestMatchResponse
Returns a new instance of BestMatchResponse.
20 21 22 23 24 |
# File 'lib/dto/search/best_match_response.rb', line 20 def initialize(hash = {}) hash.each do |key, value| self.send("#{key}=".to_sym, value ) end end |
Instance Attribute Details
#category ⇒ Object
Returns the value of attribute category
15 16 17 |
# File 'lib/dto/search/best_match_response.rb', line 15 def category @category end |
#error ⇒ Object
Returns the value of attribute error
15 16 17 |
# File 'lib/dto/search/best_match_response.rb', line 15 def error @error end |
#numResults ⇒ Object
Returns the value of attribute numResults
15 16 17 |
# File 'lib/dto/search/best_match_response.rb', line 15 def numResults @numResults end |