Class: Mutant::AST::Pattern::Deep Private

Inherits:
Mutant::AST::Pattern show all
Defined in:
lib/mutant/ast/pattern.rb

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.

Instance Method Summary collapse

Methods inherited from Mutant::AST::Pattern

parse

Instance Method Details

#match?(node) ⇒ Boolean

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:

  • (Boolean)


115
116
117
118
119
120
121
# File 'lib/mutant/ast/pattern.rb', line 115

def match?(node)
  Structure.for(node.type).each_node(node) do |child|
    return true if pattern.match?(child)
  end

  false
end