Class: Spree::Stock::Differentiator Private
- Inherits:
-
Object
- Object
- Spree::Stock::Differentiator
- Defined in:
- app/models/spree/stock/differentiator.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
- #missing ⇒ Object readonly private
- #order ⇒ Object readonly private
- #packages ⇒ Object readonly private
- #packed ⇒ Object readonly private
- #required ⇒ Object readonly private
Instance Method Summary collapse
-
#initialize(order, packages) ⇒ Differentiator
constructor
private
A new instance of Differentiator.
- #missing? ⇒ Boolean private
Constructor Details
#initialize(order, packages) ⇒ Differentiator
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 Differentiator.
6 7 8 9 10 11 12 |
# File 'app/models/spree/stock/differentiator.rb', line 6 def initialize(order, packages) @order = order @packages = packages build_packed build_required build_missing end |
Instance Attribute Details
#missing ⇒ Object (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/differentiator.rb', line 4 def missing @missing end |
#order ⇒ Object (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/differentiator.rb', line 4 def order @order end |
#packages ⇒ Object (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/differentiator.rb', line 4 def packages @packages end |
#packed ⇒ Object (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/differentiator.rb', line 4 def packed @packed end |
#required ⇒ Object (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/differentiator.rb', line 4 def required @required end |
Instance Method Details
#missing? ⇒ Boolean
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.
14 15 16 |
# File 'app/models/spree/stock/differentiator.rb', line 14 def missing? missing.values.any? { |v| v > 0 } end |