Class: PromotionRule
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- PromotionRule
show all
- Defined in:
- app/models/promotion_rule.rb
Overview
Base class for all promotion rules
Constant Summary
collapse
- @@rule_classes =
Set.new
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.register ⇒ Object
14
15
16
|
# File 'app/models/promotion_rule.rb', line 14
def self.register
@@rule_classes.add(self)
end
|
.rule_class_names ⇒ Object
.rule_classes ⇒ Object
18
19
20
|
# File 'app/models/promotion_rule.rb', line 18
def self.rule_classes
@@rule_classes.to_a
end
|
Instance Method Details
#eligible?(order) ⇒ Boolean
8
9
10
|
# File 'app/models/promotion_rule.rb', line 8
def eligible?(order)
raise 'eligible? should be implemented in a sub-class of Promotion::PromotionRule'
end
|