class SpreeClient::API::V1::StockLocations

Stock Locations @see SpreeClient::API:V1::Resource

Constants

ENDPOINT
NAME
RESOURCE

Public Instance Methods

stock_items(**args) click to toggle source

@return [SpreeClient::API::V1::StockItems]

   # File lib/spree_client/api/v1/stock_locations.rb
22 def stock_items(**args)
23   stock_location_id = default_args.dig(:id) || args.dig(:stock_location_id)
24 
25   raise ArgumentError, 'Needs a stock location ID' unless stock_location_id
26 
27   @stock_items ||= {}
28   @stock_items[stock_location_id.to_s.to_sym] ||= StockItems.new **{ api: api, stock_location_id: stock_location_id }.merge(args)
29 end
stock_movements(**args) click to toggle source

@return [SpreeClient::API::V1::StockMovements]

   # File lib/spree_client/api/v1/stock_locations.rb
12 def stock_movements(**args)
13   stock_location_id = default_args.dig(:id) || args.dig(:stock_location_id)
14 
15   raise ArgumentError, 'Needs a stock location ID' unless stock_location_id
16 
17   @stock_movements ||= {}
18   @stock_movements[stock_location_id.to_s.to_sym] ||= StockMovements.new **{ api: api, stock_location_id: stock_location_id }.merge(args)
19 end