Class: RubyEventStore::Subscriptions::ThreadSubscriptions
- Inherits:
-
Object
- Object
- RubyEventStore::Subscriptions::ThreadSubscriptions
- Defined in:
- lib/ruby_event_store/subscriptions.rb
Instance Attribute Summary collapse
-
#global ⇒ Object
readonly
Returns the value of attribute global.
-
#local ⇒ Object
readonly
Returns the value of attribute local.
Instance Method Summary collapse
- #all_for(event_type) ⇒ Object
-
#initialize ⇒ ThreadSubscriptions
constructor
A new instance of ThreadSubscriptions.
Constructor Details
#initialize ⇒ ThreadSubscriptions
Returns a new instance of ThreadSubscriptions.
38 39 40 41 |
# File 'lib/ruby_event_store/subscriptions.rb', line 38 def initialize @local = ThreadLocalSubscriptions.new @global = ThreadGlobalSubscriptions.new end |
Instance Attribute Details
#global ⇒ Object (readonly)
Returns the value of attribute global.
42 43 44 |
# File 'lib/ruby_event_store/subscriptions.rb', line 42 def global @global end |
#local ⇒ Object (readonly)
Returns the value of attribute local.
42 43 44 |
# File 'lib/ruby_event_store/subscriptions.rb', line 42 def local @local end |
Instance Method Details
#all_for(event_type) ⇒ Object
44 45 46 |
# File 'lib/ruby_event_store/subscriptions.rb', line 44 def all_for(event_type) [global, local].map { |r| r.all_for(event_type) }.reduce(&:+) end |