diff --git a/lib/mutant/matcher.rb b/lib/mutant/matcher.rb index e286511f..dc32dc51 100644 --- a/lib/mutant/matcher.rb +++ b/lib/mutant/matcher.rb @@ -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] - # 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 diff --git a/lib/mutant/matcher/scope.rb b/lib/mutant/matcher/scope.rb index aae70d64..72221d57 100644 --- a/lib/mutant/matcher/scope.rb +++ b/lib/mutant/matcher/scope.rb @@ -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