Module: Spree::API::Client::Products
- Included in:
- Spree::API::Client
- Defined in:
- lib/spree-api-client/products.rb
Instance Method Summary collapse
- #create_product(options = {}) ⇒ Object
- #delete_product(permalink_or_id, options = {}) ⇒ Object
- #new_product(options = {}) ⇒ Object
- #product(permalink_or_id, options = {}) ⇒ Object
- #product_by_sku(options = {}) ⇒ Object
- #products(options = {}) ⇒ Object
- #update_product(permalink_or_id, options = {}) ⇒ Object
Instance Method Details
#create_product(options = {}) ⇒ Object
21 22 23 |
# File 'lib/spree-api-client/products.rb', line 21 def create_product(={}) post("products", ) end |
#delete_product(permalink_or_id, options = {}) ⇒ Object
29 30 31 |
# File 'lib/spree-api-client/products.rb', line 29 def delete_product(permalink_or_id, ={}) delete("products/#{permalink_or_id}", ) end |
#new_product(options = {}) ⇒ Object
17 18 19 |
# File 'lib/spree-api-client/products.rb', line 17 def new_product(={}) get("products/#{permalink_or_id}/new", ) end |
#product(permalink_or_id, options = {}) ⇒ Object
9 10 11 |
# File 'lib/spree-api-client/products.rb', line 9 def product(permalink_or_id, ={}) get("products/#{permalink_or_id}", ) end |
#product_by_sku(options = {}) ⇒ Object
13 14 15 |
# File 'lib/spree-api-client/products.rb', line 13 def product_by_sku(={}) get("products/find_by_sku", ) end |
#products(options = {}) ⇒ Object
5 6 7 |
# File 'lib/spree-api-client/products.rb', line 5 def products(={}) get('products', )['products'] end |
#update_product(permalink_or_id, options = {}) ⇒ Object
25 26 27 |
# File 'lib/spree-api-client/products.rb', line 25 def update_product(permalink_or_id, ={}) put("products/#{permalink_or_id}", ) end |