Class: Gitlab::Ci::Pipeline::Expression::Lexeme::Base
- Inherits:
-
Object
- Object
- Gitlab::Ci::Pipeline::Expression::Lexeme::Base
- Defined in:
- lib/gitlab/ci/pipeline/expression/lexeme/base.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.build(token) ⇒ Object
17 18 19 |
# File 'lib/gitlab/ci/pipeline/expression/lexeme/base.rb', line 17 def self.build(token) raise NotImplementedError end |
.consume?(lexeme) ⇒ Boolean
31 32 33 |
# File 'lib/gitlab/ci/pipeline/expression/lexeme/base.rb', line 31 def self.consume?(lexeme) lexeme && precedence >= lexeme.precedence end |
.pattern ⇒ Object
27 28 29 |
# File 'lib/gitlab/ci/pipeline/expression/lexeme/base.rb', line 27 def self.pattern self::PATTERN end |
.scan(scanner) ⇒ Object
21 22 23 24 25 |
# File 'lib/gitlab/ci/pipeline/expression/lexeme/base.rb', line 21 def self.scan(scanner) if scanner.scan(pattern) Expression::Token.new(scanner.matched, self) end end |
Instance Method Details
#evaluate(**variables) ⇒ Object
9 10 11 |
# File 'lib/gitlab/ci/pipeline/expression/lexeme/base.rb', line 9 def evaluate(**variables) raise NotImplementedError end |
#name ⇒ Object
13 14 15 |
# File 'lib/gitlab/ci/pipeline/expression/lexeme/base.rb', line 13 def name self.class.name.demodulize.underscore end |