Sha256: 351ba0f567ebd5cdb385ddea10f2ba6bcc26e92a6a6f92b6a88ac712833ed4db

Contents?: true

Size: 728 Bytes

Versions: 4

Compression:

Stored size: 728 Bytes

Contents

module Mutant
  class Mutator
    class Node
      class FormalArguments19

        # Mutator for default argument values
        class DefaultMutations < Node

        private

          # Emit mutations
          #
          # @return [undefined]
          #
          # @api private
          #
          def dispatch
            return unless node.defaults
            emit_attribute_mutations(:defaults) do |mutation|
              mutation.optional = mutation.defaults.names
              mutation.names = mutation.required + mutation.optional
              if mutation.defaults.names.empty?
                mutation.defaults = nil
              end
            end 
          end

        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mutant-0.2.12 lib/mutant/mutator/node/formal_arguments_19/default_mutations.rb
mutant-0.2.11 lib/mutant/mutator/node/formal_arguments_19/default_mutations.rb
mutant-0.2.9 lib/mutant/mutator/node/formal_arguments_19/default_mutations.rb
mutant-0.2.8 lib/mutant/mutator/node/formal_arguments_19/default_mutations.rb