Module: Milo::Product

Included in:
Main
Defined in:
lib/milo/product.rb

Instance Method Summary collapse

Instance Method Details

#get_product_by_id(id, options = {}) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/milo/product.rb', line 12

def get_product_by_id(id, options = {})
  base = "products?product_ids=#{id}"
  base.tap do |b|
    b.concat("&show=#{options[:show]}") if options[:show].present?
  end
  make_request(base)
end

#get_product_by_upc(upc, options = {}) ⇒ Object



20
21
22
23
24
25
26
# File 'lib/milo/product.rb', line 20

def get_product_by_upc(upc, options = {})
  base = "products?q=upc:#{upc}"
  base.tap do |b|
    b + "&show=#{options[:show]}" if options[:show].present?
  end
  make_request(base)
end

#get_products(options = {}) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/milo/product.rb', line 4

def get_products(options = {})
  base = "products"
  base.tap do |b|
    b + "?show=#{options[:show]}" if options[:show].present?
  end
  make_request("products")
end