Class: RubyEventStore::Subscriptions::GlobalSubscriptions

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_event_store/subscriptions.rb

Instance Method Summary collapse

Constructor Details

#initializeGlobalSubscriptions

Returns a new instance of GlobalSubscriptions.


79
80
81
# File 'lib/ruby_event_store/subscriptions.rb', line 79

def initialize
  @subscriptions = []
end

Instance Method Details

#add(subscription) ⇒ Object


83
84
85
86
# File 'lib/ruby_event_store/subscriptions.rb', line 83

def add(subscription)
  @subscriptions << subscription
  ->() { @subscriptions.delete(subscription) }
end

#all_for(_event_type) ⇒ Object


88
89
90
# File 'lib/ruby_event_store/subscriptions.rb', line 88

def all_for(_event_type)
  @subscriptions
end