Sha256: 055e9572de75d866bab83e26aa415807b0fcd44f9518c11c4814b2dc1ec5b114

Contents?: true

Size: 668 Bytes

Versions: 7

Compression:

Stored size: 668 Bytes

Contents

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

      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.new(env, scope).each(&block)
        end

        self
      end

    end # Scope
  end # Matcher
end # Mutant

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
mutant-0.8.7 lib/mutant/matcher/scope.rb
mutant-0.8.6 lib/mutant/matcher/scope.rb
mutant-0.8.5 lib/mutant/matcher/scope.rb
mutant-0.8.4 lib/mutant/matcher/scope.rb
mutant-0.8.3 lib/mutant/matcher/scope.rb
mutant-0.8.2 lib/mutant/matcher/scope.rb
mutant-0.8.1 lib/mutant/matcher/scope.rb