Publisher — Documentation by YARD 0.9.37 (original) (raw)
Module: Mongo::Event::Publisher
Overview
This module is included for objects that need to publish events.
Instance Attribute Summary collapse
- #event_listeners ⇒ Event::Listeners readonly
Event_listeners The listeners.
Instance Method Summarycollapse
- #publish(event, *args) ⇒ Object
Publish the provided event.
Instance Attribute Details
#event_listeners ⇒ Event::Listeners
Returns event_listeners The listeners.
27 28 29 | # File 'lib/mongo/event/publisher.rb', line 27 def event_listeners @event_listeners end |
---|
Instance Method Details
#publish(event, *args) ⇒ Object
Publish the provided event.
| 38 39 40 41 42 | # File 'lib/mongo/event/publisher.rb', line 38 def publish(event, *args) event_listeners.listeners_for(event).each do |listener| listener.handle(*args) end end | | -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |