Class: Evilution::Mutator::Operator::MixinRemoval::ScopeFinder Private
- Inherits:
-
Prism::Visitor
- Object
- Prism::Visitor
- Evilution::Mutator::Operator::MixinRemoval::ScopeFinder
- Defined in:
- lib/evilution/mutator/operator/mixin_removal.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.
Visitor to find the ClassNode or ModuleNode enclosing a given line number.
Instance Attribute Summary collapse
- #result ⇒ Object readonly private
Instance Method Summary collapse
-
#initialize(target_line) ⇒ ScopeFinder
constructor
private
A new instance of ScopeFinder.
- #visit_class_node(node) ⇒ Object private
- #visit_module_node(node) ⇒ Object private
Constructor Details
#initialize(target_line) ⇒ ScopeFinder
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 a new instance of ScopeFinder.
72 73 74 75 |
# File 'lib/evilution/mutator/operator/mixin_removal.rb', line 72 def initialize(target_line) @target_line = target_line @result = nil end |
Instance Attribute Details
#result ⇒ Object (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.
70 71 72 |
# File 'lib/evilution/mutator/operator/mixin_removal.rb', line 70 def result @result end |
Instance Method Details
#visit_class_node(node) ⇒ 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.
77 78 79 80 |
# File 'lib/evilution/mutator/operator/mixin_removal.rb', line 77 def visit_class_node(node) @result = node if @target_line.between?(node.location.start_line, node.location.end_line) super end |
#visit_module_node(node) ⇒ 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.
82 83 84 85 |
# File 'lib/evilution/mutator/operator/mixin_removal.rb', line 82 def visit_module_node(node) @result = node if @target_line.between?(node.location.start_line, node.location.end_line) super end |