Class: ROM::Repository::MapperBuilder Private

Inherits:
Object
  • Object
show all
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

Class Method Summary collapse

Instance Method Summary collapse

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_builderObject (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

#registryObject (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

.registryObject

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