Class: Spree::Stock::Coordinator Private

Inherits:
Object
  • Object
show all
Defined in:
app/models/spree/stock/coordinator.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Coordinator) initialize(order, inventory_units = nil)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

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

- (Object) inventory_units (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



4
5
6
# File 'app/models/spree/stock/coordinator.rb', line 4

def inventory_units
  @inventory_units
end

- (Object) order (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



4
5
6
# File 'app/models/spree/stock/coordinator.rb', line 4

def order
  @order
end

Instance Method Details

- (Object) shipments

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



12
13
14
# File 'app/models/spree/stock/coordinator.rb', line 12

def shipments
  packages.map(&:shipment)
end