Class: Spree::PromotionHandler::Page
- Inherits:
-
Object
- Object
- Spree::PromotionHandler::Page
- Defined in:
- app/models/spree/promotion_handler/page.rb
Instance Attribute Summary collapse
-
#order ⇒ Object
readonly
Returns the value of attribute order.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #activate ⇒ Object
-
#initialize(order, path) ⇒ Page
constructor
A new instance of Page.
Constructor Details
#initialize(order, path) ⇒ Page
Returns a new instance of Page.
6 7 8 9 |
# File 'app/models/spree/promotion_handler/page.rb', line 6 def initialize(order, path) @order = order @path = path.gsub(/\A\//, '') end |
Instance Attribute Details
#order ⇒ Object (readonly)
Returns the value of attribute order.
4 5 6 |
# File 'app/models/spree/promotion_handler/page.rb', line 4 def order @order end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
4 5 6 |
# File 'app/models/spree/promotion_handler/page.rb', line 4 def path @path end |
Instance Method Details
#activate ⇒ Object
11 12 13 14 15 |
# File 'app/models/spree/promotion_handler/page.rb', line 11 def activate if promotion && promotion.eligible?(order) promotion.activate(:order => order) end end |