Class: EventEngine::Subscribers::Base
- Inherits:
-
Object
- Object
- EventEngine::Subscribers::Base
- Defined in:
- lib/event_engine/subscribers/base.rb
Overview
Base class for event subscribers. Subclasses declare the event they handle
with subscribes_to and implement #handle(event). Declaring the
subscription self-registers the subclass in the Registry at load time, so
no explicit wiring is needed.
Class Method Summary collapse
-
.subscribes_to(event_name) ⇒ void
Registers this subscriber class for an event.
Instance Method Summary collapse
-
#handle(event) ⇒ Object
Handles a dispatched event.
Class Method Details
Instance Method Details
#handle(event) ⇒ Object
Handles a dispatched event. Subclasses must override this.
29 30 31 |
# File 'lib/event_engine/subscribers/base.rb', line 29 def handle(event) raise NotImplementedError, "#{self.class} must implement #handle" end |