Remove singleton .each on matcher

This commit is contained in:
Markus Schirp 2014-06-29 00:10:11 +00:00
parent 55b93b5d76
commit ab91e3d8ba
2 changed files with 1 additions and 21 deletions

View file

@ -3,26 +3,6 @@ module Mutant
class Matcher
include Adamantium::Flat, Enumerable, AbstractType
# Enumerate subjects
#
# @param [Object] input
#
# @return [self]
# if block given
#
# @return [Enumerable<Subject>]
# otherwise
#
# @api private
#
def self.each(cache, input, &block)
return to_enum(__method__, cache, input) unless block_given?
build(cache, input).each(&block)
self
end
# Default matcher build implementation
#
# @param [Cache] cache

View file

@ -23,7 +23,7 @@ module Mutant
return to_enum unless block_given?
MATCHERS.each do |matcher|
matcher.each(cache, scope, &block)
matcher.new(cache, scope).each(&block)
end
self