Class: ASTTransform::AbstractTransformation
- Inherits:
-
Parser::AST::Processor
- Object
- Parser::AST::Processor
- ASTTransform::AbstractTransformation
- Includes:
- TransformationHelper
- Defined in:
- lib/ast_transform/abstract_transformation.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#process(node) ⇒ Object
Used internally by Parser::AST::Processor to process each node.
-
#run(node) ⇒ Parser::AST::Node
Runs this transformation on
node.
Methods included from TransformationHelper
Instance Method Details
#process(node) ⇒ Object
Used internally by Parser::AST::Processor to process each node. DO NOT OVERRIDE.
19 20 21 22 23 |
# File 'lib/ast_transform/abstract_transformation.rb', line 19 def process(node) return node unless node.is_a?(Parser::AST::Node) process_node(node) end |
#run(node) ⇒ Parser::AST::Node
Runs this transformation on node. Note: If you want to add one-time checks to the transformation, override this, then call super.
14 15 16 |
# File 'lib/ast_transform/abstract_transformation.rb', line 14 def run(node) process(node) end |