Class: Mutant::Mutator::Util

Inherits:
Mutant::Mutator show all
Defined in:
lib/mutant/mutator/util.rb,
lib/mutant/mutator/util/array.rb,
lib/mutant/mutator/util/symbol.rb

Overview

Namespace for utility mutators

Direct Known Subclasses

Array, Array::Element, Array::Presence, Symbol

Defined Under Namespace

Classes: Array, Symbol

Instance Attribute Summary

Attributes inherited from Mutant::Mutator

#input

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Mutant::Mutator

identity

Class Method Details

.each(object, &block) ⇒ Enumerator<Object>, self

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Run ulitity mutator

Parameters:

  • object (Object)

Returns:

  • (Enumerator<Object>)

    if no block given

  • (self)

    otherwise



18
19
20
21
22
23
24
# File 'lib/mutant/mutator/util.rb', line 18

def self.each(object, &block)
  return to_enum(__method__, object) unless block_given?

  new(object, block)

  self
end

Instance Method Details

#new?(generated) ⇒ true, false

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Test if mutation is new

Parameters:

  • generated (Object)

Returns:

  • (true)

    if object is new

  • (false)

    otherwise



38
39
40
# File 'lib/mutant/mutator/util.rb', line 38

def new?(generated)
  input != generated
end