free_mutant/lib/mutant/cli/classifier/scope.rb
Dan Kubb 7293386c26 Add magic encoding header to all ruby files
* rubocop still warns about this on ruby 1.9.3, so it was fixed so
  it produces less output on travis.
2013-07-28 16:03:06 -07:00

37 lines
619 B
Ruby

# encoding: utf-8
module Mutant
class CLI
class Classifier
# Scope classifier
class Scope < self
REGEXP = /\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