Class: Mutant::Expression::Methods
- Inherits:
-
Mutant::Expression
- Object
- Mutant::Expression
- Mutant::Expression::Methods
- Defined in:
- lib/mutant/expression/methods.rb
Overview
Abstract base class for methods expression
Constant Summary collapse
- MATCHERS =
IceNine.deep_freeze( '.' => Matcher::Methods::Singleton, '#' => Matcher::Methods::Instance )
- REGEXP =
/\A#{SCOPE_NAME_PATTERN}#{SCOPE_SYMBOL_PATTERN}\z/.freeze
Constants inherited from Mutant::Expression
SCOPE_NAME_PATTERN, SCOPE_SYMBOL_PATTERN
Instance Method Summary collapse
-
#match_length(expression) ⇒ Fixnum
private
Length of match with other expression.
-
#matcher(env) ⇒ Matcher::Method
private
Matcher on expression.
-
#syntax ⇒ String
private
Syntax of expression.
Methods inherited from Mutant::Expression
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.
Length of match with other expression
45 46 47 48 49 50 51 |
# File 'lib/mutant/expression/methods.rb', line 45 def match_length(expression) if expression.syntax.start_with?(syntax) syntax.length else 0 end end |
#matcher(env) ⇒ Matcher::Method
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 on expression
34 35 36 |
# File 'lib/mutant/expression/methods.rb', line 34 def matcher(env) MATCHERS.fetch(scope_symbol).new(env, scope) end |
#syntax ⇒ String
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
22 23 24 |
# File 'lib/mutant/expression/methods.rb', line 22 def syntax [scope_name, scope_symbol].join end |