Class: Comable::Inventory::Unit
- Inherits:
-
Object
- Object
- Comable::Inventory::Unit
- Defined in:
- app/models/comable/inventory/unit.rb
Instance Attribute Summary collapse
-
#variant ⇒ Object
Returns the value of attribute variant.
Instance Method Summary collapse
-
#initialize(variant) ⇒ Unit
constructor
A new instance of Unit.
- #to_shipment_item(shipment) ⇒ Object
Constructor Details
#initialize(variant) ⇒ Unit
Returns a new instance of Unit.
6 7 8 |
# File 'app/models/comable/inventory/unit.rb', line 6 def initialize(variant) @variant = variant end |
Instance Attribute Details
#variant ⇒ Object
Returns the value of attribute variant.
4 5 6 |
# File 'app/models/comable/inventory/unit.rb', line 4 def variant @variant end |
Instance Method Details
#to_shipment_item(shipment) ⇒ Object
10 11 12 13 |
# File 'app/models/comable/inventory/unit.rb', line 10 def to_shipment_item(shipment) stock = find_stock_item(shipment) Comable::ShipmentItem.new(stock: stock) end |