Class: Triggerable::Action
- Inherits:
-
Object
- Object
- Triggerable::Action
- Defined in:
- lib/triggerable/actions.rb
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.build(source) ⇒ Object
3 4 5 6 7 8 9 10 11 12 |
# File 'lib/triggerable/actions.rb', line 3 def self.build source if source.is_a?(Proc) [LambdaAction.new(source)] else Array(source).map do |source| descendant = descendants.find { |d| d == source.to_s.camelize.constantize } descendant.new if descendant.present? end.compact end end |
Instance Method Details
#run_for!(trigger_name, object) ⇒ Object
14 |
# File 'lib/triggerable/actions.rb', line 14 def run_for!(trigger_name, object); end |