class Triggerable::Rules::Trigger
Attributes
callback[RW]
Public Class Methods
new(model, options, block)
click to toggle source
Calls superclass method
Triggerable::Rules::Rule::new
# File lib/triggerable/rules/trigger.rb, line 6 def initialize model, options, block super @callback = options[:on] end
Public Instance Methods
execute!(object)
click to toggle source
# File lib/triggerable/rules/trigger.rb, line 11 def execute! object return unless condition.true_for?(object) actions.each do |action| begin action.run_for!(object, name) rescue Exception => ex Triggerable::Engine.log(:error, "#{desc} failed with exception #{ex}") end end end