Class: AmazonMwsProducts::ListMatchingProducts

Inherits:
Object
  • Object
show all
Defined in:
lib/amazon_mws_products/list_matching_products.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ ListMatchingProducts

Returns a new instance of ListMatchingProducts.



5
6
7
8
9
# File 'lib/amazon_mws_products/list_matching_products.rb', line 5

def initialize(options)
  @account          = options.fetch(:account)
  @query            = options.fetch(:query)
  @query_context_id = options[:query_context_id]
end

Instance Attribute Details

#accountObject (readonly)

Returns the value of attribute account.



3
4
5
# File 'lib/amazon_mws_products/list_matching_products.rb', line 3

def 
  @account
end

#queryObject (readonly)

Returns the value of attribute query.



3
4
5
# File 'lib/amazon_mws_products/list_matching_products.rb', line 3

def query
  @query
end

#query_context_idObject (readonly)

Returns the value of attribute query_context_id.



3
4
5
# File 'lib/amazon_mws_products/list_matching_products.rb', line 3

def query_context_id
  @query_context_id
end

Instance Method Details

#clientObject



17
18
19
# File 'lib/amazon_mws_products/list_matching_products.rb', line 17

def client
  Client.new(, 'ListMatchingProducts')
end

#executeObject



11
12
13
14
15
# File 'lib/amazon_mws_products/list_matching_products.rb', line 11

def execute
  params = { "Query" => URI.encode(query) }
  params["QueryContextId"] = query_context_id if query_context_id
  client.get(params)
end