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



9
10
11
# File 'lib/rbs/test/observer.rb', line 9

def notify(key, *args)
  @@observers[key]&.call(*args)
end

.register(key, object = nil, &block) ⇒ Object



13
14
15
# File 'lib/rbs/test/observer.rb', line 13

def register(key, object = nil, &block)
  @@observers[key] = object || block
end