Class: AbstractMapper::SoleRule Abstract
- Defined in:
- lib/abstract_mapper/sole_rule.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::Node
readonly
The node to be optimized.
Attributes inherited from Rule
Class Method Summary collapse
- .initialize(node) ⇒ Object
-
.new(node) ⇒ AbstractMapper::Rule
Creates a rule applied to the sole node.
Methods inherited from Rule
call, optimize, optimize?, transproc
Instance Attribute Details
#node ⇒ AbstractMapper::Node (readonly)
Returns The node to be optimized.
38 39 40 |
# File 'lib/abstract_mapper/sole_rule.rb', line 38 def node @node end |
Class Method Details
.initialize(node) ⇒ Object
49 50 51 52 |
# File 'lib/abstract_mapper/sole_rule.rb', line 49 def initialize(node) @node = node super end |
.new(node) ⇒ AbstractMapper::Rule
Creates a rule applied to the sole node
|
# File 'lib/abstract_mapper/sole_rule.rb', line 40
|