Class: Comable::Inventory::Coordinator

Inherits:
Object
  • Object
show all
Defined in:
app/models/comable/inventory/coordinator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(order) ⇒ Coordinator

Returns a new instance of Coordinator.



7
8
9
10
# File 'app/models/comable/inventory/coordinator.rb', line 7

def initialize(order)
  @order = order
  @units = build_units
end

Instance Attribute Details

#orderObject

Returns the value of attribute order.



4
5
6
# File 'app/models/comable/inventory/coordinator.rb', line 4

def order
  @order
end

#unitsObject

Returns the value of attribute units.



5
6
7
# File 'app/models/comable/inventory/coordinator.rb', line 5

def units
  @units
end

Instance Method Details

#shipmentsObject



12
13
14
# File 'app/models/comable/inventory/coordinator.rb', line 12

def shipments
  packages.map(&:to_shipment)
end