Class: Spree::PromotionAction
- Defined in:
- app/models/spree/promotion_action.rb
Overview
Base class for all types of promotion action.
PromotionActions perform the necessary tasks when a promotion is activated by an event and determined to be eligible.
Direct Known Subclasses
Spree::Promotion::Actions::CreateAdjustment, Spree::Promotion::Actions::CreateItemAdjustments, Spree::Promotion::Actions::FreeShipping
Instance Method Summary collapse
-
#perform(options = {}) ⇒ Object
Updates the state of the order or performs some other action depending on the subclass options will contain the payload from the event that activated the promotion.
Methods inherited from Base
Methods included from Spree::Preferences::Preferable
#default_preferences, #defined_preferences, #get_preference, #has_preference!, #has_preference?, #preference_default, #preference_type, #set_preference
Instance Method Details
#perform(options = {}) ⇒ Object
This method should be overriden in subclassses.
Updates the state of the order or performs some other action depending on the subclass options will contain the payload from the event that activated the promotion. This will include the key :user which allows user based actions to be performed in addition to actions on the order
19 20 21 |
# File 'app/models/spree/promotion_action.rb', line 19 def perform( = {}) raise 'perform should be implemented in a sub-class of PromotionAction' end |