Method: Mutant::AST::FindMetaclassContaining#call

Defined in:
lib/mutant/ast/find_metaclass_containing.rb

#callParser::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.

Find metaclass node containing target node



24
25
26
27
28
29
30
# File 'lib/mutant/ast/find_metaclass_containing.rb', line 24

def call
  Structure.for(ast.node.type).each_node(ast.node) do |current|
    return current if n_sclass?(current) && metaclass_of?(current)
  end

  nil
end