Module: Mongo::Event::Publisher
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Included In:
| |
Defined in: | lib/mongo/event/publisher.rb |
Overview
This module is included for objects that need to publish events.
Instance Attribute Summary
- #event_listeners ⇒ Event::Listeners readonly
Instance Method Summary
-
#publish(event, *args)
Publish the provided event.
Instance Attribute Details
#event_listeners ⇒ Event::Listeners (readonly)
# File 'lib/mongo/event/publisher.rb', line 27
attr_reader :event_listeners
Instance Method Details
#publish(event, *args)
Publish the provided event.
# 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