Skip to content

Commit

Permalink
Implemented SimilarityLookup operations. They've gone in with the Ite…
Browse files Browse the repository at this point in the history
…m* operations in the Item module.
  • Loading branch information
Jon Gilbraith committed Jun 11, 2009
1 parent 37aa552 commit 585f70f
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions lib/amazon_product_advertising_api/operations/item.rb
Expand Up @@ -99,6 +99,34 @@ def params
end

end

class SimilarityLookup < AmazonProductAdvertisingApi::Operations::Base::Request

include Common

REQUEST_PARAMETERS = :condition, :item_id, :merchant_id, :similarity_type, :response_group

REQUEST_PARAMETERS.each do |param|
self.send(:attr_accessor, param)
end

def initialize(item_id, region = :uk)
super()

self.item_id = item_id
self.operation = "SimilarityLookup"
self.region = region
end

private
def params
REQUEST_PARAMETERS.inject({}) do |parameters, parameter|
parameters[parameter] = eval("self.#{parameter}") unless eval("self.#{parameter}.nil?")
parameters
end
end

end

end
end
Expand Down

0 comments on commit 585f70f

Please sign in to comment.