Module: Milo::Product
- Included in:
- Main
- Defined in:
- lib/milo/product.rb
Instance Method Summary collapse
- #get_product_by_id(id, options = {}) ⇒ Object
- #get_product_by_upc(upc, options = {}) ⇒ Object
- #get_products(options = {}) ⇒ Object
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, = {}) base = "products?product_ids=#{id}" base.tap do |b| b.concat("&show=#{[:show]}") if [: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, = {}) base = "products?q=upc:#{upc}" base.tap do |b| b + "&show=#{[:show]}" if [: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( = {}) base = "products" base.tap do |b| b + "?show=#{[:show]}" if [:show].present? end make_request("products") end |