Lift shared code to baseclass

This commit is contained in:
Markus Schirp 2014-09-17 00:47:09 +00:00
parent abc52ebbce
commit 831a1750f6

View file

@ -4,6 +4,18 @@ module Mutant
class Namespace < self
include AbstractType
private
# Return matched namespace
#
# @return [String]
#
# @api private
#
def namespace
match[__method__]
end
# Recursive namespace expression
class Recursive < self
@ -52,18 +64,6 @@ module Mutant
end
end
private
# Return matched namespace
#
# @return [String]
#
# @api private
#
def namespace
match[__method__] || EMPTY_STRING
end
end # Recursive
# Exact namespace expression
@ -85,18 +85,6 @@ module Mutant
Matcher::Scope.new(env, Mutant.constant_lookup(namespace), self)
end
private
# Return namespace
#
# @return [String]
#
# @api private
#
def namespace
match[__method__].to_s
end
end # Exact
end # Namespace
end # Namespace