Module: Spree::API::Client::StockItems

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

Instance Method Summary collapse

Instance Method Details

#batch_update_stock_items(location = 1, options = {}) ⇒ Object



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

def batch_update_stock_items(location=1, options={})
  put("stock_locations/#{location}/stock_items/batch_update", options)
end

#create_stock_item(location, options = {}) ⇒ Object



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

def create_stock_item(location, options={})
  post("stock_locations/#{location}/stock_items", options)
end

#delete_stock_item(stock_item, location = 1, options = {}) ⇒ Object



29
30
31
# File 'lib/spree-api-client/stock_items.rb', line 29

def delete_stock_item(stock_item, location=1, options={})
  delete("stock_locations/#{location}/stock_items/#{stock_item}", options)
end

#new_stock_item(options = {}) ⇒ Object



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

def new_stock_item(options={})
  get("stock_items/#{permalink_or_id}/new", options)
end

#stock_item(stock_item, location = 1, options = {}) ⇒ Object



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

def stock_item(stock_item, location=1, options={})
  get("stock_locations/#{location}/stock_items/#{stock_item}", options)
end

#stock_items(location = 1, options = {}) ⇒ Object



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

def stock_items(location=1, options={})
  get("stock_locations/#{location}/stock_items/", options)
end

#update_stock_item(stock_item, location = 1, options = {}) ⇒ Object



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

def update_stock_item(stock_item, location=1, options={})
  put("stock_locations/#{location}/stock_items/#{stock_item}", options)
end