Class: Comable::Inventory::Adjuster
- Inherits:
-
Object
- Object
- Comable::Inventory::Adjuster
- Defined in:
- app/models/comable/inventory/adjuster.rb
Instance Attribute Summary collapse
-
#packages ⇒ Object
Returns the value of attribute packages.
-
#units ⇒ Object
Returns the value of attribute units.
Instance Method Summary collapse
- #adjusted_packages ⇒ Object
-
#initialize(packages, units) ⇒ Adjuster
constructor
A new instance of Adjuster.
Constructor Details
#initialize(packages, units) ⇒ Adjuster
Returns a new instance of Adjuster.
7 8 9 10 |
# File 'app/models/comable/inventory/adjuster.rb', line 7 def initialize(packages, units) @packages = packages.map(&:clone) @units = units end |
Instance Attribute Details
#packages ⇒ Object
Returns the value of attribute packages.
4 5 6 |
# File 'app/models/comable/inventory/adjuster.rb', line 4 def packages @packages end |
#units ⇒ Object
Returns the value of attribute units.
5 6 7 |
# File 'app/models/comable/inventory/adjuster.rb', line 5 def units @units end |
Instance Method Details
#adjusted_packages ⇒ Object
12 13 14 15 |
# File 'app/models/comable/inventory/adjuster.rb', line 12 def adjusted_packages remove_duplicated_items packages end |