class Mutiny::Mutants::MutantSet

Attributes

mutants[R]

Public Class Methods

new(*mutants) click to toggle source
# File lib/mutiny/mutants/mutant_set.rb, line 12
def initialize(*mutants)
  @mutants = mutants
end

Public Instance Methods

==(other)
Alias for: eql?
eql?(other) click to toggle source
# File lib/mutiny/mutants/mutant_set.rb, line 33
def eql?(other)
  other.mutants == mutants
end
Also aliased as: ==
group_by_subject() click to toggle source
# File lib/mutiny/mutants/mutant_set.rb, line 20
def group_by_subject
  mutants.group_by(&:subject).dup
end
hash() click to toggle source
# File lib/mutiny/mutants/mutant_set.rb, line 39
def hash
  mutants.hash
end
ordered() click to toggle source
# File lib/mutiny/mutants/mutant_set.rb, line 24
def ordered
  group_by_subject.flat_map do |_, mutants|
    mutants.map.with_index do |mutant, index|
      mutant.index ||= index
      mutant
    end
  end
end
subjects() click to toggle source
# File lib/mutiny/mutants/mutant_set.rb, line 16
def subjects
  mutants.map(&:subject).uniq
end