Class: RubyEventStore::Subscriptions::GlobalSubscriptions
- Inherits:
-
Object
- Object
- RubyEventStore::Subscriptions::GlobalSubscriptions
- Defined in:
- lib/ruby_event_store/subscriptions.rb
Instance Method Summary collapse
- #add(subscription) ⇒ Object
- #all_for(_event_type) ⇒ Object
-
#initialize ⇒ GlobalSubscriptions
constructor
A new instance of GlobalSubscriptions.
Constructor Details
#initialize ⇒ GlobalSubscriptions
Returns a new instance of GlobalSubscriptions.
65 66 67 |
# File 'lib/ruby_event_store/subscriptions.rb', line 65 def initialize @subscriptions = [] end |
Instance Method Details
#add(subscription) ⇒ Object
69 70 71 72 |
# File 'lib/ruby_event_store/subscriptions.rb', line 69 def add(subscription) @subscriptions << subscription -> { @subscriptions.delete(subscription) } end |
#all_for(_event_type) ⇒ Object
74 75 76 |
# File 'lib/ruby_event_store/subscriptions.rb', line 74 def all_for(_event_type) @subscriptions end |