Method: Mutant::Mutator::Node.mutate

Defined in:
lib/mutant/mutator/node.rb

.mutate(config:, node:, parent: nil) ⇒ Set<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.

Lookup and invoke dedicated AST mutator

Parameters:

Returns:

  • (Set<Parser::AST::Node>)


25
26
27
28
29
30
31
32
33
34
35
# File 'lib/mutant/mutator/node.rb', line 25

def self.mutate(config:, node:, parent: nil)
  config.ignore_patterns.each do |pattern|
    return Set.new if pattern.match?(node)
  end

  self::REGISTRY.lookup(node.type).call(
    config:,
    input:  node,
    parent:
  )
end