Module: Mongo::Event::Subscriber
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Included In:
| |
Defined in: | lib/mongo/event/subscriber.rb |
Overview
Adds convenience methods for adding listeners to event publishers.
Instance Attribute Summary
- #event_listeners ⇒ Event::Listeners readonly
Instance Method Summary
-
#subscribe_to(event, listener)
Subscribe to the provided event.
Instance Attribute Details
#event_listeners ⇒ Event::Listeners (readonly)
# File 'lib/mongo/event/subscriber.rb', line 27
attr_reader :event_listeners
Instance Method Details
#subscribe_to(event, listener)
Subscribe to the provided event.
# File 'lib/mongo/event/subscriber.rb', line 38
def subscribe_to(event, listener) event_listeners.add_listener(event, listener) end