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.



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