Class: Mutant::AST::Pattern::Node::Descendant Private

Inherits:
Object
  • Object
show all
Defined in:
lib/mutant/ast/pattern.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.

Attribute

Instance Method Summary collapse

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)


66
67
68
69
70
# File 'lib/mutant/ast/pattern.rb', line 66

def match?(node)
  descendant = Structure.for(node.type).descendant(name).value(node)

  !descendant.nil? && pattern.match?(descendant)
end

#syntaxObject

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.



72
73
74
# File 'lib/mutant/ast/pattern.rb', line 72

def syntax
  "#{name}=#{pattern.syntax}"
end