Class: A2WS::ItemSearch
Class Method Summary collapse
Methods inherited from Base
api_key=, configure, request_uri, secret_key, secret_key=
Methods included from Signature
Class Method Details
.find(keywords, search_index = :All, options = {}) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/a2ws/item_search.rb', line 5 def self.find(keywords, search_index = :All, = {}) .merge!({:Keywords => keywords, :SearchIndex => search_index}) query = sign_request() puts query.inspect result = get( request_uri, :query => query ) puts result.inspect items = result["ItemSearchResponse"]["Items"] if items['Request']['IsValid'] == 'True' [ items['Item'] ].flatten.compact.collect do |i| Item.new downcase_keys(i) end else raise items['Request']['Errors']['Error']['Message'] end end |