Class: Mutant::Matcher::Filter

Inherits:
Mutant::Matcher show all
Defined in:
lib/mutant/matcher/filter.rb

Overview

Matcher filter

Instance Method Summary collapse

Methods inherited from Mutant::Matcher

build, each, #identification

Instance Method Details

#eachself, Enumerator<Subject>

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.

Enumerate matches

Returns:

  • (self)

    if block given

  • (Enumerator<Subject>)

    otherwise



19
20
21
22
23
24
25
26
27
28
# File 'lib/mutant/matcher/filter.rb', line 19

def each
  return to_enum unless block_given?

  matcher.each do |subject|
    next if filter.match?(subject)
    yield subject
  end

  self
end