Sha256: ac8d82664e2d449f02f5f3a8f303c3c6c5acd868282cb16cb693d6928264ed9c

Contents?: true

Size: 795 Bytes

Versions: 4

Compression:

Stored size: 795 Bytes

Contents

module Mutant
  class Mutator
    # Namespace for utility mutators
    class Util < self

      # Run ulitity mutator
      #
      # @param [Object] object
      # @param [Object] parent
      #
      # @return [Enumerator<Object>]
      #   if no block given
      #
      # @return [self]
      #   otherwise
      #
      # @api private
      #
      def self.each(object, parent, &block)
        return to_enum(__method__, object, parent) unless block_given?

        new(object, parent, block)

        self
      end

    private

      # Test if mutation is new
      #
      # @param [Object] generated
      #
      # @return [Boolean]
      #
      # @api private
      #
      def new?(generated)
        !input.eql?(generated)
      end

    end # Util
  end # Mutator
end # Mutant

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mutant-0.5.26 lib/mutant/mutator/util.rb
mutant-0.5.25 lib/mutant/mutator/util.rb
mutant-0.5.24 lib/mutant/mutator/util.rb
mutant-0.5.23 lib/mutant/mutator/util.rb