Lift shared code to baseclass
This commit is contained in:
parent
abc52ebbce
commit
831a1750f6
1 changed files with 12 additions and 24 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue