Class: ROM::Repository::StructBuilder Private
- Inherits:
-
Object
- Object
- ROM::Repository::StructBuilder
- Defined in:
- lib/rom/repository/struct_builder.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
- #registry ⇒ Object readonly private
Class Method Summary collapse
- .registry ⇒ Object private
Instance Method Summary collapse
- #call(*args) ⇒ Object (also: #[]) private
-
#initialize ⇒ StructBuilder
constructor
private
A new instance of StructBuilder.
Constructor Details
#initialize ⇒ StructBuilder
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 StructBuilder.
15 16 17 |
# File 'lib/rom/repository/struct_builder.rb', line 15 def initialize @registry = self.class.registry end |
Instance Attribute Details
#registry ⇒ 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.
9 10 11 |
# File 'lib/rom/repository/struct_builder.rb', line 9 def registry @registry end |
Class Method Details
.registry ⇒ 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.
11 12 13 |
# File 'lib/rom/repository/struct_builder.rb', line 11 def self.registry @__registry__ ||= {} end |
Instance Method Details
#call(*args) ⇒ Object Also known as: []
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 22 23 24 |
# File 'lib/rom/repository/struct_builder.rb', line 19 def call(*args) name, columns = args registry[args.hash] ||= build_class(name) { |klass| klass.send(:include, Anima.new(*columns)) } end |