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
|
||||
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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue