Remove singleton .each on matcher
This commit is contained in:
parent
55b93b5d76
commit
ab91e3d8ba
2 changed files with 1 additions and 21 deletions
|
@ -3,26 +3,6 @@ module Mutant
|
||||||
class Matcher
|
class Matcher
|
||||||
include Adamantium::Flat, Enumerable, AbstractType
|
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
|
# Default matcher build implementation
|
||||||
#
|
#
|
||||||
# @param [Cache] cache
|
# @param [Cache] cache
|
||||||
|
|
|
@ -23,7 +23,7 @@ module Mutant
|
||||||
return to_enum unless block_given?
|
return to_enum unless block_given?
|
||||||
|
|
||||||
MATCHERS.each do |matcher|
|
MATCHERS.each do |matcher|
|
||||||
matcher.each(cache, scope, &block)
|
matcher.new(cache, scope).each(&block)
|
||||||
end
|
end
|
||||||
|
|
||||||
self
|
self
|
||||||
|
|
Loading…
Reference in a new issue