Sha256: f4190a2ca689f1f26871a7afc6770c5eb312cba5ce6e8db770ef2a3a9de8c208

Contents?: true

Size: 516 Bytes

Versions: 9

Compression:

Stored size: 516 Bytes

Contents

# encoding: utf-8

module Mutant
  class Mutator
    class Node
      # Mutator for nth-ref nodes
      class NthRef < self

        handle :nth_ref

        children :number

      private

        # Perform dispatch
        #
        # @return [undefined]
        #
        # @api private
        #
        def dispatch
          unless number.equal?(1)
            emit_number(number - 1)
          end
          emit_number(number + 1)
        end

      end # NthRef
    end # Node
  end # Mutator
end # Mutant

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
mutant-0.5.19 lib/mutant/mutator/node/nthref.rb
mutant-0.5.18 lib/mutant/mutator/node/nthref.rb
mutant-0.5.17 lib/mutant/mutator/node/nthref.rb
mutant-0.5.16 lib/mutant/mutator/node/nthref.rb
mutant-0.5.15 lib/mutant/mutator/node/nthref.rb
mutant-0.5.14 lib/mutant/mutator/node/nthref.rb
mutant-0.5.13 lib/mutant/mutator/node/nthref.rb
mutant-0.5.12 lib/mutant/mutator/node/nthref.rb
mutant-0.5.11 lib/mutant/mutator/node/nthref.rb