Method: Workflow::EventCollection#first_applicable

Defined in:
lib/workflow/event_collection.rb

#first_applicable(name, object_context, event_arguments) ⇒ Object



29
30
31
32
33
# File 'lib/workflow/event_collection.rb', line 29

def first_applicable(name, object_context, event_arguments)
  (self[name] || []).detect do |event|
    event.condition_applicable?(object_context, event_arguments) && event
  end
end