class Mutest::Expression::Namespace::Recursive

Recursive namespace expression

Constants

REGEXP

Public Class Methods

new(*) click to toggle source

Initialize object

@return [undefined]

Calls superclass method
# File lib/mutest/expression/namespace.rb, line 16
def initialize(*)
  super
  @recursion_pattern = Regexp.union(
    /\A#{scope_name}\z/,
    /\A#{scope_name}::/,
    /\A#{scope_name}[.#]/
  )
end

Public Instance Methods

match_length(expression) click to toggle source

Length of match with other expression

@param [Expression] expression

@return [Integer]

# File lib/mutest/expression/namespace.rb, line 45
def match_length(expression)
  if @recursion_pattern =~ expression.syntax
    scope_name.length
  else
    0
  end
end
matcher() click to toggle source

Matcher for expression

@return [Matcher]

# File lib/mutest/expression/namespace.rb, line 36
def matcher
  Matcher::Namespace.new(self)
end
syntax() click to toggle source

Syntax for expression

@return [String]

# File lib/mutest/expression/namespace.rb, line 28
def syntax
  "#{scope_name}*"
end