free_mutant/lib/mutant/matcher/scope.rb

34 lines
668 B
Ruby
Raw Normal View History

module Mutant
class Matcher
# Matcher for specific namespace
class Scope < self
include Concord::Public.new(:env, :scope, :expression)
MATCHERS = [
2013-06-14 14:54:02 -04:00
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
2013-06-14 14:54:02 -04:00
end # Scope
end # Matcher
end # Mutant