Sha256: d6a981a14e6a26a7ee40f73e635b3ffac37a74ee0faa7435c259cae8421c23a1

Contents?: true

Size: 708 Bytes

Versions: 12

Compression:

Stored size: 708 Bytes

Contents

# 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
#
class BestMatchResponse < Struct.new(:category, :numResults, :error) do
    def num_results
      numResults
    end
  end
  def initialize(hash = {})
    hash.each do |key, value|
      self.send("#{key}=".to_sym, value )
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
threetaps-client-1.0.14 lib/dto/search/best_match_response.rb
threetaps-client-1.0.13 lib/dto/search/best_match_response.rb
threetaps-client-1.0.12 lib/dto/search/best_match_response.rb
threetaps-client-1.0.11 lib/dto/search/best_match_response.rb
threetaps-client-1.0.10 lib/dto/search/best_match_response.rb
threetaps-client-1.0.9 lib/dto/search/best_match_response.rb
threetaps-client-1.0.8 lib/dto/search/best_match_response.rb
threetaps-client-1.0.7 lib/dto/search/best_match_response.rb
threetaps-client-1.0.6 lib/dto/search/best_match_response.rb
threetaps-client-1.0.5 lib/dto/search/best_match_response.rb
threetaps-client-1.0.4 lib/dto/search/best_match_response.rb
threetaps-client-1.0.3 lib/dto/search/best_match_response.rb