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, #identification

Instance Method Details

#each(&block) ⇒ self, 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



17
18
19
20
21
# File 'lib/mutant/matcher/filter.rb', line 17

def each(&block)
  return to_enum unless block_given?
  matcher.select(&predicate.method(:call)).each(&block)
  self
end