Class: RubyReactor::Registry

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_reactor/registry.rb

Overview

Registry for dynamically created reactor classes (e.g. from inline map/compose) This avoids polluting the global constant namespace with runtime-generated constants.

Class Method Summary collapse

Class Method Details

.clear!Object



20
21
22
# File 'lib/ruby_reactor/registry.rb', line 20

def clear!
  @reactors.clear
end

.find(name) ⇒ Object



16
17
18
# File 'lib/ruby_reactor/registry.rb', line 16

def find(name)
  @reactors[name]
end

.register(name, klass) ⇒ Object



12
13
14
# File 'lib/ruby_reactor/registry.rb', line 12

def register(name, klass)
  @reactors[name] = klass
end