Class: ChatSDK::EventRegistry
- Inherits:
-
Object
- Object
- ChatSDK::EventRegistry
- Defined in:
- lib/chat_sdk/event_registry.rb
Defined Under Namespace
Classes: Handler
Instance Method Summary collapse
- #handlers_for(event) ⇒ Object
-
#initialize ⇒ EventRegistry
constructor
A new instance of EventRegistry.
- #register(type, matcher: nil, &block) ⇒ Object
Constructor Details
#initialize ⇒ EventRegistry
Returns a new instance of EventRegistry.
7 8 9 |
# File 'lib/chat_sdk/event_registry.rb', line 7 def initialize @handlers = [] end |
Instance Method Details
#handlers_for(event) ⇒ Object
15 16 17 |
# File 'lib/chat_sdk/event_registry.rb', line 15 def handlers_for(event) @handlers.select { |h| matches?(h, event) } end |