Class: Spree::PriceRule
- Inherits:
-
Object
- Object
- Spree::PriceRule
- Defined in:
- app/models/spree/price_rule.rb
Direct Known Subclasses
Spree::PriceRules::CustomerGroupRule, Spree::PriceRules::MarketRule, Spree::PriceRules::UserRule, Spree::PriceRules::VolumeRule, Spree::PriceRules::ZoneRule
Class Method Summary collapse
-
.description ⇒ String
Returns the description of the price rule.
-
.human_name ⇒ String
Returns the human name of the price rule.
Instance Method Summary collapse
-
#applicable?(context) ⇒ Boolean
Returns true if the price rule is applicable to the context.
Class Method Details
.description ⇒ String
Returns the description of the price rule
24 25 26 |
# File 'app/models/spree/price_rule.rb', line 24 def self.description '' end |
.human_name ⇒ String
Returns the human name of the price rule
18 19 20 |
# File 'app/models/spree/price_rule.rb', line 18 def self.human_name name.demodulize.titleize end |
Instance Method Details
#applicable?(context) ⇒ Boolean
Returns true if the price rule is applicable to the context
12 13 14 |
# File 'app/models/spree/price_rule.rb', line 12 def applicable?(context) raise NotImplementedError, "#{self.class.name} must implement #applicable?" end |