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