Class: CWlogsIO::HandlerManager
- Inherits:
-
Object
- Object
- CWlogsIO::HandlerManager
- Includes:
- Singleton
- Defined in:
- lib/cwlogs_io/handler.rb
Instance Method Summary collapse
- #deregister(handler) ⇒ Object
-
#initialize ⇒ HandlerManager
constructor
A new instance of HandlerManager.
- #register(handler) ⇒ Object
- #respawn_all ⇒ Object
Constructor Details
#initialize ⇒ HandlerManager
Returns a new instance of HandlerManager.
36 37 38 |
# File 'lib/cwlogs_io/handler.rb', line 36 def initialize @handlers = Set.new end |
Instance Method Details
#deregister(handler) ⇒ Object
48 49 50 |
# File 'lib/cwlogs_io/handler.rb', line 48 def deregister(handler) @handlers.delete(handler) end |
#register(handler) ⇒ Object
44 45 46 |
# File 'lib/cwlogs_io/handler.rb', line 44 def register(handler) @handlers << handler end |
#respawn_all ⇒ Object
40 41 42 |
# File 'lib/cwlogs_io/handler.rb', line 40 def respawn_all @handlers.each(&:respawn) end |