Class: ROM::MapperCompiler Private
- Inherits:
-
Object
- Object
- ROM::MapperCompiler
- Extended by:
- 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.
Instance Attribute Summary collapse
- #struct_compiler ⇒ Object readonly private
Instance Method Summary collapse
- #call(ast) ⇒ Object (also: #[]) private
-
#initialize(*args) ⇒ MapperCompiler
constructor
private
A new instance of MapperCompiler.
Constructor Details
#initialize(*args) ⇒ MapperCompiler
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.
16 17 18 19 20 |
# File 'lib/rom/mapper_compiler.rb', line 16 def initialize(*args) super @struct_compiler = StructCompiler.new(cache: cache) @cache = cache.namespaced(:mappers) end |
Instance Attribute Details
#struct_compiler ⇒ 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.
14 15 16 |
# File 'lib/rom/mapper_compiler.rb', line 14 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.
22 23 24 |
# File 'lib/rom/mapper_compiler.rb', line 22 def call(ast) cache.fetch_or_store(ast.hash) { Mapper.build(Header.coerce(*visit(ast))) } end |