Class: Spree::PriceRule
- Inherits:
-
Object
- Object
- Spree::PriceRule
- Defined in:
- app/models/spree/price_rule.rb
Direct Known Subclasses
Spree::PriceRules::CustomerGroupRule, 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
22 23 24 |
# File 'app/models/spree/price_rule.rb', line 22 def self.description '' end |
.human_name ⇒ String
Returns the human name of the price rule
16 17 18 |
# File 'app/models/spree/price_rule.rb', line 16 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
10 11 12 |
# File 'app/models/spree/price_rule.rb', line 10 def applicable?(context) raise NotImplementedError, "#{self.class.name} must implement #applicable?" end |