Sha256: 350c9bea639355cbb23760b56e1a0a540e0b267e4468b91675c6c22fe32a7fbd

Contents?: true

Size: 920 Bytes

Versions: 7

Compression:

Stored size: 920 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) do |children|
            if children.length > 1
              emit_self(*children)
            end
          end
          children.each do |child|
            emit(child)
          end
          emit(nil) unless parent_send?
        end

        # Test if parent input is a send
        #
        # @return [true]
        #   if parent input is a send node
        #
        # @return [false]
        #   otherwise
        #
        # @api private
        #
        def parent_send?
          parent && parent.input.type == :send
        end

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

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
mutant-0.3.0.beta9 lib/mutant/mutator/node/begin.rb
mutant-0.3.0.beta8 lib/mutant/mutator/node/begin.rb
mutant-0.3.0.beta7 lib/mutant/mutator/node/begin.rb
mutant-0.3.0.beta6 lib/mutant/mutator/node/begin.rb
mutant-0.3.0.beta5 lib/mutant/mutator/node/begin.rb
mutant-0.3.0.beta4 lib/mutant/mutator/node/begin.rb
mutant-0.3.0.beta3 lib/mutant/mutator/node/begin.rb