Module: Tasker::Concerns::StateMachineBase::StateMachineBase::ClassMethods

Defined in:
lib/tasker/concerns/state_machine_base.rb

Instance Method Summary collapse

Instance Method Details

#publish_event(event_name, context = {}) ⇒ Object

Use EventPublisher for consistent event publishing



198
199
200
201
202
# File 'lib/tasker/concerns/state_machine_base.rb', line 198

def publish_event(event_name, context = {})
  # Create a temporary object to access the concern method
  publisher = Object.new.extend(EventPublisher)
  publisher.send(:publish_event, event_name, context)
end