Class: ROM::MapperCompiler Private
- Inherits:
-
Object
- Object
- ROM::MapperCompiler
- 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
Instance Attribute Summary collapse
- #mapper_options ⇒ Object readonly private
- #struct_compiler ⇒ Object readonly private
Instance Method Summary collapse
- #call(ast) ⇒ Object (also: #[]) private
-
#initialize ⇒ MapperCompiler
constructor
private
A new instance of MapperCompiler.
Constructor Details
#initialize ⇒ 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.
27 28 29 30 31 32 |
# File 'lib/rom/mapper_compiler.rb', line 27 def initialize(*) super @struct_compiler = StructCompiler.new(cache: cache) @cache = cache.namespaced(:mappers) @mapper_options = self.class. end |
Instance Attribute Details
#mapper_options ⇒ 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.
25 26 27 |
# File 'lib/rom/mapper_compiler.rb', line 25 def @mapper_options end |
#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.
23 24 25 |
# File 'lib/rom/mapper_compiler.rb', line 23 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.
35 36 37 |
# File 'lib/rom/mapper_compiler.rb', line 35 def call(ast) cache.fetch_or_store(ast.hash) { Mapper.build(Header.coerce(*visit(ast))) } end |