Class: Space::Events::Sources
- Inherits:
-
Object
- Object
- Space::Events::Sources
- Defined in:
- lib/space/events/sources.rb
Instance Attribute Summary collapse
-
#events ⇒ Object
readonly
Returns the value of attribute events.
-
#sources ⇒ Object
readonly
Returns the value of attribute sources.
Instance Method Summary collapse
-
#initialize(events) ⇒ Sources
constructor
A new instance of Sources.
- #registered ⇒ Object
Constructor Details
#initialize(events) ⇒ Sources
Returns a new instance of Sources.
6 7 8 9 |
# File 'lib/space/events/sources.rb', line 6 def initialize(events) @events = events @sources = [] end |
Instance Attribute Details
#events ⇒ Object (readonly)
Returns the value of attribute events.
4 5 6 |
# File 'lib/space/events/sources.rb', line 4 def events @events end |
#sources ⇒ Object (readonly)
Returns the value of attribute sources.
4 5 6 |
# File 'lib/space/events/sources.rb', line 4 def sources @sources end |
Instance Method Details
#registered ⇒ Object
11 12 13 14 15 16 |
# File 'lib/space/events/sources.rb', line 11 def registered register(Thread.current.object_id) yield.tap do unregister(Thread.current.object_id) end end |