Module: Comable::Variant::Quantifier
- Included in:
- Comable::Variant
- Defined in:
- app/models/comable/variant/quantifier.rb
Instance Method Summary collapse
-
#backorderable? ⇒ Boolean
TODO: Implement.
- #can_supply?(required = 1) ⇒ Boolean
- #total_quantity ⇒ Object
-
#track_inventory? ⇒ Boolean
TODO: Implement.
Instance Method Details
#backorderable? ⇒ Boolean
TODO: Implement
22 23 24 |
# File 'app/models/comable/variant/quantifier.rb', line 22 def backorderable? false end |
#can_supply?(required = 1) ⇒ Boolean
12 13 14 |
# File 'app/models/comable/variant/quantifier.rb', line 12 def can_supply?(required = 1) quantity >= required || backorderable? end |
#total_quantity ⇒ Object
4 5 6 7 8 9 10 |
# File 'app/models/comable/variant/quantifier.rb', line 4 def total_quantity if track_inventory? stocks.to_a.sum(&:quantity) else Float::INFINITY end end |
#track_inventory? ⇒ Boolean
TODO: Implement
17 18 19 |
# File 'app/models/comable/variant/quantifier.rb', line 17 def track_inventory? true end |