Class: Mutant::Matcher::Filter
- Inherits:
-
Mutant::Matcher
- Object
- Mutant::Matcher
- Mutant::Matcher::Filter
- Defined in:
- lib/mutant/matcher/filter.rb
Overview
Matcher filter
Class Method Summary collapse
-
.build(matcher, &predicate) ⇒ Matcher
private
New matcher.
Instance Method Summary collapse
-
#each(&block) ⇒ self, Enumerator<Subject>
private
Enumerate matches.
Class Method Details
.build(matcher, &predicate) ⇒ Matcher
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.
New matcher
14 15 16 |
# File 'lib/mutant/matcher/filter.rb', line 14 def self.build(matcher, &predicate) new(matcher, predicate) end |
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
27 28 29 30 31 |
# File 'lib/mutant/matcher/filter.rb', line 27 def each(&block) return to_enum unless block_given? matcher.select(&predicate.method(:call)).each(&block) self end |