Class: ROM::Factory::Registry Private

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

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRegistry

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Registry.



14
15
16
# File 'lib/rom/factory/registry.rb', line 14

def initialize
  @elements = {}
end

Instance Attribute Details

#elementsObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



11
12
13
# File 'lib/rom/factory/registry.rb', line 11

def elements
  @elements
end

Instance Method Details

#[](name) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



29
30
31
32
33
# File 'lib/rom/factory/registry.rb', line 29

def [](name)
  elements.fetch(name) do
    raise FactoryNotDefinedError, name
  end
end

#[]=(name, builder) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



24
25
26
# File 'lib/rom/factory/registry.rb', line 24

def []=(name, builder)
  elements[name] = builder
end

#key?(name) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


19
20
21
# File 'lib/rom/factory/registry.rb', line 19

def key?(name)
  elements.key?(name)
end