Class: Mutest::Expression::Method Private

Inherits:
Mutest::Expression show all
Defined in:
lib/mutest/expression/method.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Explicit method expression

Constant Summary collapse

MATCHERS =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

IceNine.deep_freeze(
  '.' => Matcher::Methods::Singleton,
  '#' => Matcher::Methods::Instance
)
METHOD_NAME_PATTERN =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Regexp.union(
  /(?<method_name>[A-Za-z_][A-Za-z\d_]*[!?=]?)/,
  *AST::Types::OPERATOR_METHODS.map(&:to_s)
).freeze
REGEXP =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

/\A#{SCOPE_NAME_PATTERN}#{SCOPE_SYMBOL_PATTERN}#{METHOD_NAME_PATTERN}\z/

Constants inherited from Mutest::Expression

SCOPE_NAME_PATTERN, SCOPE_SYMBOL_PATTERN

Instance Method Summary collapse

Methods inherited from Mutest::Expression

#match_length, #prefix?, try_parse

Instance Method Details

#matcherMatcher

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.

Matcher for expression

Returns:



38
39
40
41
42
# File 'lib/mutest/expression/method.rb', line 38

def matcher
  methods_matcher = MATCHERS.fetch(scope_symbol).new(scope)

  Matcher::Filter.new(methods_matcher, ->(subject) { subject.expression.eql?(self) })
end

#syntaxString

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.

Syntax of expression

Returns:

  • (String)


30
31
32
# File 'lib/mutest/expression/method.rb', line 30

def syntax
  [scope_name, scope_symbol, method_name].join
end