Module: ViglinkApi::Product

Included in:
Client
Defined in:
lib/viglink_api/product.rb

Instance Method Summary collapse

Instance Method Details

#find_products(options = {}) ⇒ Hashie::Mash

Retrieve the list of Products the complete response

Parameters:

  • :full (Boolean)

    If set to true|y|yes then this will return

Returns:

  • (Hashie::Mash)

    Product



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/viglink_api/product.rb', line 12

def find_products(options={})
  full_response = options.delete(:full) if options[:full]
  options[:key] = @api_key
  products_response = get('/vigcatalog/products.xml', options)

  if full_response.to_s.to_bool or @api_full_response
    products_response.response if products_response.response
  else
    products_response.response.results.products if products_response.response.results
  end
end