Class: AbstractMapper::Rules::Sole Abstract
- Defined in:
- lib/abstract_mapper/rules/sole.rb
Overview
This class is abstract.
The abstract class that describes the rule to be applied to sole nodes.
The subclass should implement two instance methods:
-
‘#optimize?` to check if the optimization should be applied to the node
-
‘#optimize` that should return the optimized node
Instance Attribute Summary collapse
-
#node ⇒ AbstractMapper::AST::Node
readonly
The node to be optimized.
Attributes inherited from Base
Class Method Summary collapse
- .initialize(node) ⇒ Object
-
.new(node) ⇒ AbstractMapper::Rules::Base
Creates a rule applied to the sole node.
Methods inherited from Base
#call, #initialize, #optimize, #optimize?, transproc
Constructor Details
This class inherits a constructor from AbstractMapper::Rules::Base
Instance Attribute Details
#node ⇒ AbstractMapper::AST::Node (readonly)
Returns The node to be optimized.
40 41 42 |
# File 'lib/abstract_mapper/rules/sole.rb', line 40 def node @node end |
Class Method Details
.initialize(node) ⇒ Object
51 52 53 54 |
# File 'lib/abstract_mapper/rules/sole.rb', line 51 def initialize(node) @node = node super end |
.new(node) ⇒ AbstractMapper::Rules::Base
Creates a rule applied to the sole node
|
# File 'lib/abstract_mapper/rules/sole.rb', line 42
|