Sha256: cf6be518c97423c2334c181c6a30cefc57e516b55d6b6e7e31c632e7d64acf21

Contents?: true

Size: 751 Bytes

Versions: 6

Compression:

Stored size: 751 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
              mutation
            end 
          end

        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
mutant-0.2.20 lib/mutant/mutator/node/formal_arguments_19/default_mutations.rb
mutant-0.2.17 lib/mutant/mutator/node/formal_arguments_19/default_mutations.rb
mutant-0.2.16 lib/mutant/mutator/node/formal_arguments_19/default_mutations.rb
mutant-0.2.15 lib/mutant/mutator/node/formal_arguments_19/default_mutations.rb
mutant-0.2.14 lib/mutant/mutator/node/formal_arguments_19/default_mutations.rb
mutant-0.2.13 lib/mutant/mutator/node/formal_arguments_19/default_mutations.rb