Class: Spree::Stock::Prioritizer
- Inherits:
-
Object
- Object
- Spree::Stock::Prioritizer
- Defined in:
- app/models/spree/stock/prioritizer.rb
Instance Attribute Summary collapse
-
#order ⇒ Object
readonly
Returns the value of attribute order.
-
#packages ⇒ Object
readonly
Returns the value of attribute packages.
Instance Method Summary collapse
-
#initialize(order, packages, adjuster_class = Adjuster) ⇒ Prioritizer
constructor
A new instance of Prioritizer.
- #prioritized_packages ⇒ Object
Constructor Details
#initialize(order, packages, adjuster_class = Adjuster) ⇒ Prioritizer
Returns a new instance of Prioritizer.
6 7 8 9 10 |
# File 'app/models/spree/stock/prioritizer.rb', line 6 def initialize(order, packages, adjuster_class=Adjuster) @order = order @packages = packages @adjuster_class = adjuster_class end |
Instance Attribute Details
#order ⇒ Object (readonly)
Returns the value of attribute order.
4 5 6 |
# File 'app/models/spree/stock/prioritizer.rb', line 4 def order @order end |
#packages ⇒ Object (readonly)
Returns the value of attribute packages.
4 5 6 |
# File 'app/models/spree/stock/prioritizer.rb', line 4 def packages @packages end |
Instance Method Details
#prioritized_packages ⇒ Object
12 13 14 15 16 17 |
# File 'app/models/spree/stock/prioritizer.rb', line 12 def prioritized_packages sort_packages adjust_packages prune_packages packages end |