Class: Mutant::Matcher::Chain
- Inherits:
-
Mutant::Matcher
- Object
- Mutant::Matcher
- Mutant::Matcher::Chain
- Defined in:
- lib/mutant/matcher/chain.rb
Overview
A chain of matchers
Class Method Summary collapse
-
.build(matchers) ⇒ Matcher
private
Build matcher chain.
Instance Method Summary collapse
-
#each(&block) ⇒ Enumerator<Subject] if no block given, self
private
Enumerate subjects.
Methods inherited from Mutant::Matcher
Class Method Details
.build(matchers) ⇒ 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.
Build matcher chain
37 38 39 40 41 42 43 |
# File 'lib/mutant/matcher/chain.rb', line 37 def self.build(matchers) if matchers.length == 1 return matchers.first end new(matchers) end |
Instance Method Details
#each(&block) ⇒ Enumerator<Subject] if no block given, 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.
Enumerate subjects
19 20 21 22 23 24 25 26 27 |
# File 'lib/mutant/matcher/chain.rb', line 19 def each(&block) return to_enum unless block_given? matchers.each do |matcher| matcher.each(&block) end self end |