Class: AbstractMapper::Builder Private
- Inherits:
-
Object
- Object
- AbstractMapper::Builder
- Defined in:
- lib/abstract_mapper/builder.rb
Overview
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.
Builds the immutable abstract syntax tree (AST) using DSL commands.
Class Attribute Summary collapse
-
.commands ⇒ AbstractMapper::Commands
The registry of DSL commands.
Instance Attribute Summary collapse
-
#tree ⇒ AbstractMapper::Branch
readonly
private
The updated tree.
Class Method Summary collapse
- .initialize(node, &block) ⇒ Object private
-
.new(node, &block) ⇒ AbstractMapper::Builder
Builds the AST by recursively adding new nodes, using the commands.
Class Attribute Details
.commands ⇒ AbstractMapper::Commands
Returns The registry of DSL commands.
25 26 27 |
# File 'lib/abstract_mapper/builder.rb', line 25 def commands @commands end |
Instance Attribute Details
#tree ⇒ AbstractMapper::Branch (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 updated tree.
46 47 48 |
# File 'lib/abstract_mapper/builder.rb', line 46 def tree @tree end |
Class Method Details
.initialize(node, &block) ⇒ 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.
60 61 62 63 64 65 |
# File 'lib/abstract_mapper/builder.rb', line 60 def initialize(node, &block) @tree = node @commands = self.class.commands instance_eval(&block) if block_given? freeze end |
.new(node, &block) ⇒ AbstractMapper::Builder
Builds the AST by recursively adding new nodes, using the commands
|
|
# File 'lib/abstract_mapper/builder.rb', line 48
|