Class: ROM::Repository::MapperBuilder Private
- Inherits:
-
Object
- Object
- ROM::Repository::MapperBuilder
- Defined in:
- lib/rom/repository/mapper_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
- #header_builder ⇒ Object readonly private
- #registry ⇒ Object readonly private
Class Method Summary collapse
- .new(header_builder = HeaderBuilder.new) ⇒ Object private
- .registry ⇒ Object private
Instance Method Summary collapse
- #call(ast) ⇒ Object (also: #[]) private
-
#initialize(header_builder) ⇒ MapperBuilder
constructor
private
A new instance of MapperBuilder.
Constructor Details
#initialize(header_builder) ⇒ MapperBuilder
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 MapperBuilder.
19 20 21 22 |
# File 'lib/rom/repository/mapper_builder.rb', line 19 def initialize(header_builder) @header_builder = header_builder @registry = self.class.registry end |
Instance Attribute Details
#header_builder ⇒ 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.
7 8 9 |
# File 'lib/rom/repository/mapper_builder.rb', line 7 def header_builder @header_builder end |
#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/mapper_builder.rb', line 9 def registry @registry end |
Class Method Details
.new(header_builder = HeaderBuilder.new) ⇒ 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.
15 16 17 |
# File 'lib/rom/repository/mapper_builder.rb', line 15 def self.new(header_builder = HeaderBuilder.new) super end |
.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/mapper_builder.rb', line 11 def self.registry @__registry__ ||= {} end |
Instance Method Details
#call(ast) ⇒ 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.
24 25 26 |
# File 'lib/rom/repository/mapper_builder.rb', line 24 def call(ast) registry[ast.hash] ||= Mapper.build(header_builder[ast]) end |