free_mutant/lib/mutant/mutator/node/nthref.rb
John Backus eeb05a7188
Change Node#dispatch comments to standardize
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"
2016-06-18 15:56:22 -07:00

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