Class: ROM::MapperCompiler Private

Inherits:
Object
  • Object
show all
Extended by:
Dry::Core::ClassAttributes, Initializer
Defined in:
lib/rom/mapper_compiler.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.

Direct Known Subclasses

ROM::Memory::MapperCompiler

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMapperCompiler

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 MapperCompiler.


28
29
30
31
32
33
# File 'lib/rom/mapper_compiler.rb', line 28

def initialize(*)
  super
  @struct_compiler = StructCompiler.new(cache: cache)
  @cache = cache.namespaced(:mappers)
  @mapper_options = self.class.mapper_options
end

Instance Attribute Details

#mapper_optionsObject (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.


26
27
28
# File 'lib/rom/mapper_compiler.rb', line 26

def mapper_options
  @mapper_options
end

#struct_compilerObject (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.


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

def struct_compiler
  @struct_compiler
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.


36
37
38
# File 'lib/rom/mapper_compiler.rb', line 36

def call(ast)
  cache.fetch_or_store(ast.hash) { Mapper.build(Header.coerce(*visit(ast))) }
end