Class: Manufacturable::SimpleRegistrar

Inherits:
Object
  • Object
show all
Defined in:
lib/manufacturable/simple_registrar.rb

Class Method Summary collapse

Instance Method Summary collapse

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