Class: Promotion::Rules::ItemTotal
- Inherits:
-
PromotionRule
- Object
- PromotionRule
- Promotion::Rules::ItemTotal
- Defined in:
- app/models/promotion/rules/item_total.rb
Overview
A rule to limit a promotion to a specific user.
Constant Summary collapse
- OPERATORS =
['gt', 'gte']
Instance Method Summary collapse
Instance Method Details
#eligible?(order) ⇒ Boolean
9 10 11 |
# File 'app/models/promotion/rules/item_total.rb', line 9 def eligible?(order) order.item_total.send(preferred_operator == 'gte' ? :>= : :>, preferred_amount) end |