Class: Acta::ReactorJob
- Inherits:
-
ActiveJob::Base
- Object
- ActiveJob::Base
- Acta::ReactorJob
- Defined in:
- lib/acta/reactor_job.rb
Instance Method Summary collapse
Instance Method Details
#perform(event_uuid:, reactor_class:, event_class:) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/acta/reactor_job.rb', line 7 def perform(event_uuid:, reactor_class:, event_class:) event = Acta.events.find_by_uuid(event_uuid) return unless event reactor = Object.const_get(reactor_class) ev_class = Object.const_get(event_class) Acta.handlers[ev_class] .select { |r| r[:handler_class] == reactor && r[:kind] == :reactor } .each { |r| r[:block].call(event) } end |