Sha256: ab093e90e9bc11b62c9019417573e9357066edb3137d960c7eb99630ec021400

Contents?: true

Size: 848 Bytes

Versions: 8

Compression:

Stored size: 848 Bytes

Contents

module Mutant
  class Mutator
    class Node

      # Mutator for begin nodes
      class Begin < self

        handle(:begin)

      private

        # Emit mutants
        #
        # @return [undefined]
        #
        # @api private
        def dispatch
          Util::Array.each(children, self, &method(:emit_child_subset))
          children.each_with_index do |child, index|
            mutate_child(index)
            emit(child) unless children.eql?([child])
          end
        end

        # Emit child subset
        #
        # @param [Array<Parser::AST::Node>] children
        #
        # @return [undefined]
        #
        # @api private
        def emit_child_subset(children)
          return if children.length < 2
          emit_type(*children)
        end

      end # Block
    end # Node
  end # Mutator
end # Mutant

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
mutant-0.8.8 lib/mutant/mutator/node/begin.rb
mutant-0.8.7 lib/mutant/mutator/node/begin.rb
mutant-0.8.6 lib/mutant/mutator/node/begin.rb
mutant-0.8.5 lib/mutant/mutator/node/begin.rb
mutant-0.8.4 lib/mutant/mutator/node/begin.rb
mutant-0.8.3 lib/mutant/mutator/node/begin.rb
mutant-0.8.2 lib/mutant/mutator/node/begin.rb
mutant-0.8.1 lib/mutant/mutator/node/begin.rb