lib/amazon/ecs.rb in amazon-ecs-0.5.2 vs lib/amazon/ecs.rb in amazon-ecs-0.5.3
- old
+ new
@@ -66,11 +66,10 @@
end
# Search amazon items with search terms. Default search index option is 'Books'.
# For other search type other than keywords, please specify :type => [search type param name].
def self.item_search(terms, opts = {})
- opts = self.options.merge(opts) if self.options
opts[:operation] = 'ItemSearch'
opts[:search_index] = opts[:search_index] || 'Books'
type = opts.delete(:type)
if type
@@ -82,18 +81,18 @@
self.send_request(opts)
end
# Search an item by ASIN no.
def self.item_lookup(item_id, opts = {})
- opts = self.options.merge(opts) if self.options
opts[:operation] = 'ItemLookup'
opts[:item_id] = item_id
self.send_request(opts)
end
# Generic send request to ECS REST service. You have to specify the :operation parameter.
def self.send_request(opts)
+ opts = self.options.merge(opts) if self.options
request_url = prepare_url(opts)
log "Request URL: #{request_url}"
res = Net::HTTP.get_response(URI::parse(request_url))
unless res.kind_of? Net::HTTPSuccess
\ No newline at end of file