
Node mutator classes all have a central #dispatch method that were previously all documented with similar but inconsistent short descriptions: - "Emit mutations" - "Emit mutants" - "Perform dispatch" This commit standardizes these comments to "Emit mutations"
26 lines
452 B
Ruby
26 lines
452 B
Ruby
module Mutant
|
|
class Mutator
|
|
class Node
|
|
# Mutator for nth-ref nodes
|
|
class NthRef < self
|
|
|
|
handle :nth_ref
|
|
|
|
children :number
|
|
|
|
private
|
|
|
|
# Emit mutations
|
|
#
|
|
# @return [undefined]
|
|
def dispatch
|
|
unless number.equal?(1)
|
|
emit_number(number - 1)
|
|
end
|
|
emit_number(number + 1)
|
|
end
|
|
|
|
end # NthRef
|
|
end # Node
|
|
end # Mutator
|
|
end # Mutant
|