Module: Vindi::Rest::Product
- Included in:
- Vindi::Rest
- Defined in:
- lib/vindi/rest/product.rb
Overview
Methods for the products API
Instance Method Summary collapse
-
#create_product(options = {}) ⇒ Hash
Create a product for a merchant vindi.
-
#list_products(options = {}) ⇒ Array<Hash>
List products for the authenticate user.
-
#product(product_id, options = {}) ⇒ Hash
Get a single product from a merchant.
-
#update_product(product_id, options = {}) ⇒ Object
Edit a product.
Instance Method Details
#create_product(options = {}) ⇒ Hash
Create a product for a merchant vindi
35 36 37 |
# File 'lib/vindi/rest/product.rb', line 35 def create_product( = {}) post('products', )[:product] end |
#list_products(options = {}) ⇒ Array<Hash>
List products for the authenticate user
13 14 15 |
# File 'lib/vindi/rest/product.rb', line 13 def list_products( = {}) get('products', )[:products] end |
#product(product_id, options = {}) ⇒ Hash
Get a single product from a merchant
24 25 26 |
# File 'lib/vindi/rest/product.rb', line 24 def product(product_id, = {}) get("products/#{product_id}", )[:product] end |
#update_product(product_id, options = {}) ⇒ Object
Edit a product
46 47 48 |
# File 'lib/vindi/rest/product.rb', line 46 def update_product(product_id, = {}) put("products/#{product_id}", )[:product] end |