Class: Mutant::Expression::Namespace::Recursive
- Inherits:
-
Mutant::Expression::Namespace
- Object
- Mutant::Expression
- Mutant::Expression::Namespace
- Mutant::Expression::Namespace::Recursive
- Defined in:
- lib/mutant/expression/namespace.rb
Overview
Recursive namespace expression
Constant Summary collapse
Constants inherited from Mutant::Expression
METHOD_NAME_PATTERN, REGISTRY, SCOPE_NAME_PATTERN, SCOPE_PATTERN
Instance Attribute Summary
Attributes inherited from Mutant::Expression
Instance Method Summary collapse
-
#initialize ⇒ undefined
constructor
private
Initialize object.
-
#match_length(expression) ⇒ Fixnum
private
Return length of match.
Methods inherited from Mutant::Expression::Namespace
Methods inherited from Mutant::Expression
Constructor Details
#initialize ⇒ undefined
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initialize object
43 44 45 46 47 |
# File 'lib/mutant/expression/namespace.rb', line 43 def initialize(*) super namespace_src = Regexp.escape(namespace) @recursion_pattern = Regexp.union(/\A#{namespace_src}\z/, /\A#{namespace_src}::/) end |
Instance Method Details
#match_length(expression) ⇒ Fixnum
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return length of match
57 58 59 60 61 62 63 |
# File 'lib/mutant/expression/namespace.rb', line 57 def match_length(expression) if @recursion_pattern =~ expression.syntax namespace.length else 0 end end |