Class: Refactor::Rule
- Inherits:
-
Parser::AST::Processor
- Object
- Parser::AST::Processor
- Refactor::Rule
- Includes:
- RuboCop::AST::Traversal
- Defined in:
- lib/refactor.rb
Overview
Wrapper for rule processors to simplify the code needed to run one.
Instance Attribute Summary collapse
-
#rewriter ⇒ Object
readonly
Returns the value of attribute rewriter.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(rewriter) ⇒ Rule
constructor
A new instance of Rule.
- #process_regular_node(node) ⇒ Object
Constructor Details
#initialize(rewriter) ⇒ Rule
Returns a new instance of Rule.
41 42 43 44 |
# File 'lib/refactor.rb', line 41 def initialize(rewriter) @rewriter = rewriter super() end |
Instance Attribute Details
#rewriter ⇒ Object (readonly)
Returns the value of attribute rewriter.
39 40 41 |
# File 'lib/refactor.rb', line 39 def rewriter @rewriter end |
Class Method Details
Instance Method Details
#process_regular_node(node) ⇒ Object
50 51 52 53 54 |
# File 'lib/refactor.rb', line 50 def process_regular_node(node) return matches(node) if defined?(matches) super() end |