Class: ROM::Factory::Registry Private
- Inherits:
-
Object
- Object
- ROM::Factory::Registry
- 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
- #elements ⇒ Object readonly private
Instance Method Summary collapse
- #[](name) ⇒ Object private
- #[]=(name, builder) ⇒ Object private
-
#initialize ⇒ Registry
constructor
private
A new instance of Registry.
- #key?(name) ⇒ Boolean private
Constructor Details
#initialize ⇒ Registry
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
#elements ⇒ Object (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.
19 20 21 |
# File 'lib/rom/factory/registry.rb', line 19 def key?(name) elements.key?(name) end |