free_mutant/lib/mutant/cli/classifier/scope.rb
2013-06-14 21:12:10 +02:00

35 lines
602 B
Ruby

module Mutant
class CLI
class Classifier
# Scope classifier
class Scope < self
REGEXP = %r(\A(#{SCOPE_PATTERN})\z).freeze
private
# Return matcher
#
# @return [Matcher]
#
# @api private
#
def matcher
Matcher::Scope.new(scope)
end
# Return namespace
#
# @return [Class, Module]
#
# @api private
#
def scope
Classifier.constant_lookup(match[1].to_s)
end
end # Scope
end # Classifier
end # CLI
end # Mutant