Module: RBS::Test::Observer
- Defined in:
- lib/rbs/test/observer.rb
Constant Summary collapse
- @@observers =
{}
Class Method Summary collapse
Class Method Details
.notify(key, *args) ⇒ Object
7 8 9 |
# File 'lib/rbs/test/observer.rb', line 7 def notify(key, *args) @@observers[key]&.call(*args) end |
.register(key, object = nil, &block) ⇒ Object
11 12 13 |
# File 'lib/rbs/test/observer.rb', line 11 def register(key, object = nil, &block) @@observers[key] = object || block end |