Class: Manufacturable::SimpleRegistrar
- Inherits:
-
Object
- Object
- Manufacturable::SimpleRegistrar
- Defined in:
- lib/manufacturable/simple_registrar.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(registry, key) ⇒ SimpleRegistrar
constructor
A new instance of SimpleRegistrar.
- #register(value) ⇒ Object
Constructor Details
#initialize(registry, key) ⇒ SimpleRegistrar
Returns a new instance of SimpleRegistrar.
19 20 21 |
# File 'lib/manufacturable/simple_registrar.rb', line 19 def initialize(registry, key) @registry, @key = registry, key end |
Class Method Details
.entries(*keys) ⇒ Object
8 9 10 |
# File 'lib/manufacturable/simple_registrar.rb', line 8 def entries(*keys) registry.slice(*keys) end |
.register(key, value) ⇒ Object
4 5 6 |
# File 'lib/manufacturable/simple_registrar.rb', line 4 def register(key, value) self.new(registry, key).register(value) end |
Instance Method Details
#register(value) ⇒ Object
23 24 25 |
# File 'lib/manufacturable/simple_registrar.rb', line 23 def register(value) @registry[registry_key] = value end |