Module: Spree::API::Client::Products

Included in:
Spree::API::Client
Defined in:
lib/spree-api-client/products.rb

Instance Method Summary collapse

Instance Method Details

#create_product(options = {}) ⇒ Object



17
18
19
# File 'lib/spree-api-client/products.rb', line 17

def create_product(options={})
  post("products", options)
end

#delete_product(permalink_or_id, options = {}) ⇒ Object



25
26
27
# File 'lib/spree-api-client/products.rb', line 25

def delete_product(permalink_or_id, options={})
  delete("products/#{permalink_or_id}", options)
end

#new_product(options = {}) ⇒ Object



13
14
15
# File 'lib/spree-api-client/products.rb', line 13

def new_product(options={})
  get("products/#{permalink_or_id}/new", options)
end

#product(permalink_or_id, options = {}) ⇒ Object



9
10
11
# File 'lib/spree-api-client/products.rb', line 9

def product(permalink_or_id, options={})
  get("products/#{permalink_or_id}", options)
end

#products(options = {}) ⇒ Object



5
6
7
# File 'lib/spree-api-client/products.rb', line 5

def products(options={})
  get('products', options)['products']
end

#update_product(permalink_or_id, options = {}) ⇒ Object



21
22
23
# File 'lib/spree-api-client/products.rb', line 21

def update_product(permalink_or_id, options={})
  put("products/#{permalink_or_id}", options)
end