Class: Mutant::AST::Pattern::Node::Attribute Private

Inherits:
Object
  • Object
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.

Defined Under Namespace

Classes: Value

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.

Value

Returns:

  • (Boolean)


54
55
56
# File 'lib/mutant/ast/pattern.rb', line 54

def match?(node)
  attribute = Structure.for(node.type).attribute(name) and value.match?(attribute.value(node))
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.



58
59
60
# File 'lib/mutant/ast/pattern.rb', line 58

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