Module: AbstractMapper::DSL Private
- Included in:
- AbstractMapper
- Defined in:
- lib/abstract_mapper/dsl.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Provides features to configure mappers
Instance Attribute Summary collapse
-
#settings ⇒ AbstractMapper::Settings
readonly
private
The configurable container of domain-specific settings (DSL commands and optimization rules along with corresponding AST builder and optimizer).
Instance Method Summary collapse
-
#configure(&block) { ... } ⇒ self
private
Configures domain-specific settings.
-
#finalize ⇒ AbstractMapper::Branch
private
Returns the optimized AST.
- #inherited(klass) ⇒ Object private
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object (private)
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.
56 57 58 |
# File 'lib/abstract_mapper/dsl.rb', line 56 def method_missing(name, *args, &block) @tree = settings.builder.update(tree) { public_send(name, *args, &block) } end |
Instance Attribute Details
#settings ⇒ AbstractMapper::Settings (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.
Returns The configurable container of domain-specific settings (DSL commands and optimization rules along with corresponding AST builder and optimizer).
23 24 25 |
# File 'lib/abstract_mapper/dsl.rb', line 23 def settings @settings end |
Instance Method Details
#configure(&block) { ... } ⇒ self
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.
Configures domain-specific settings
33 34 35 36 |
# File 'lib/abstract_mapper/dsl.rb', line 33 def configure(&block) @settings = settings ? settings.update(&block) : Settings.new(&block) self end |
#finalize ⇒ AbstractMapper::Branch
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 the optimized AST
42 43 44 |
# File 'lib/abstract_mapper/dsl.rb', line 42 def finalize settings.optimizer.update(tree) end |
#inherited(klass) ⇒ 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.
12 13 14 |
# File 'lib/abstract_mapper/dsl.rb', line 12 def inherited(klass) klass.instance_variable_set :@settings, settings end |