Module: ActsAsPurchasable::ClassMethods
- Defined in:
- app/models/concerns/acts_as_purchasable.rb
Instance Method Summary collapse
- #acts_as_purchasable? ⇒ Boolean
- #after_decline(&block) ⇒ Object
- #after_purchase(&block) ⇒ Object
- #before_purchase(&block) ⇒ Object
Instance Method Details
#acts_as_purchasable? ⇒ Boolean
45 |
# File 'app/models/concerns/acts_as_purchasable.rb', line 45 def acts_as_purchasable?; true; end |
#after_decline(&block) ⇒ Object
55 56 57 |
# File 'app/models/concerns/acts_as_purchasable.rb', line 55 def after_decline(&block) send :define_method, :after_decline do |order, order_item| self.instance_exec(order, order_item, &block) end end |
#after_purchase(&block) ⇒ Object
51 52 53 |
# File 'app/models/concerns/acts_as_purchasable.rb', line 51 def after_purchase(&block) send :define_method, :after_purchase do |order, order_item| self.instance_exec(order, order_item, &block) end end |
#before_purchase(&block) ⇒ Object
47 48 49 |
# File 'app/models/concerns/acts_as_purchasable.rb', line 47 def before_purchase(&block) send :define_method, :before_purchase do |order, order_item| self.instance_exec(order, order_item, &block) end end |