Class: Spree::Stock::Coordinator
- Inherits:
-
Object
- Object
- Spree::Stock::Coordinator
- Defined in:
- app/models/spree/stock/coordinator.rb
Instance Attribute Summary collapse
-
#inventory_units ⇒ Object
readonly
Returns the value of attribute inventory_units.
-
#order ⇒ Object
readonly
Returns the value of attribute order.
Instance Method Summary collapse
-
#initialize(order, inventory_units = nil) ⇒ Coordinator
constructor
A new instance of Coordinator.
- #shipments ⇒ Object
Constructor Details
#initialize(order, inventory_units = nil) ⇒ Coordinator
Returns a new instance of Coordinator.
6 7 8 9 10 |
# File 'app/models/spree/stock/coordinator.rb', line 6 def initialize(order, inventory_units = nil) @order = order @inventory_units = inventory_units || InventoryUnitBuilder.new(order).units @preallocated_inventory_units = [] end |
Instance Attribute Details
#inventory_units ⇒ Object (readonly)
Returns the value of attribute inventory_units.
4 5 6 |
# File 'app/models/spree/stock/coordinator.rb', line 4 def inventory_units @inventory_units end |
#order ⇒ Object (readonly)
Returns the value of attribute order.
4 5 6 |
# File 'app/models/spree/stock/coordinator.rb', line 4 def order @order end |
Instance Method Details
#shipments ⇒ Object
12 13 14 |
# File 'app/models/spree/stock/coordinator.rb', line 12 def shipments packages.map(&:shipment) end |