Class: Mutant::Matcher::Method::Finder

Inherits:
Object
  • Object
show all
Defined in:
lib/mutant/matcher/method/finder.rb

Overview

Visitor to find last match inside AST

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#matchParser::AST::Node (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.

Return match

Returns:

  • (Parser::AST::Node)


33
34
35
# File 'lib/mutant/matcher/method/finder.rb', line 33

def match
  @match
end

Class Method Details

.run(root, &predicate) ⇒ Parser::AST::Node?

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.

Run finder

Parameters:

  • (Parser::AST::Node)

Returns:

  • (Parser::AST::Node)

    if found

  • (nil)

    otherwise



21
22
23
# File 'lib/mutant/matcher/method/finder.rb', line 21

def self.run(root, &predicate)
  new(root, predicate).match
end