Sha256: 2f7f6d90c87873b99635a4d6ff70783d3ce2de45ee4703e2df1e3e7e2b94b98c

Contents?: true

Size: 648 Bytes

Versions: 3

Compression:

Stored size: 648 Bytes

Contents

module Mutant
  class Matcher
    # Matcher for specific namespace
    class Scope < self
      include Concord::Public.new(:scope)

      MATCHERS = [
        Matcher::Methods::Singleton,
        Matcher::Methods::Instance
      ].freeze

      # Enumerate subjects
      #
      # @return [self]
      #   if block given
      #
      # @return [Enumerator<Subject>]
      #   otherwise
      #
      # @api private
      #
      def each(&block)
        return to_enum unless block_given?

        MATCHERS.each do |matcher|
          matcher.each(scope, &block)
        end

        self
      end

    end # Scope
  end # Matcher
end # Mutant

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mutant-0.3.0.beta4 lib/mutant/matcher/scope.rb
mutant-0.3.0.beta3 lib/mutant/matcher/scope.rb
mutant-0.3.0.beta2 lib/mutant/matcher/scope.rb