Class: Gitlab::Ci::Pipeline::Expression::Token

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/ci/pipeline/expression/token.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value, lexeme) ⇒ Token

Returns a new instance of Token.


10
11
12
13
# File 'lib/gitlab/ci/pipeline/expression/token.rb', line 10

def initialize(value, lexeme)
  @value = value
  @lexeme = lexeme
end

Instance Attribute Details

#lexemeObject (readonly)

Returns the value of attribute lexeme


8
9
10
# File 'lib/gitlab/ci/pipeline/expression/token.rb', line 8

def lexeme
  @lexeme
end

#valueObject (readonly)

Returns the value of attribute value


8
9
10
# File 'lib/gitlab/ci/pipeline/expression/token.rb', line 8

def value
  @value
end

Instance Method Details

#build(*args) ⇒ Object


15
16
17
# File 'lib/gitlab/ci/pipeline/expression/token.rb', line 15

def build(*args)
  @lexeme.build(@value, *args)
end

#to_lexemeObject


23
24
25
# File 'lib/gitlab/ci/pipeline/expression/token.rb', line 23

def to_lexeme
  @lexeme.name.demodulize.downcase
end

#typeObject


19
20
21
# File 'lib/gitlab/ci/pipeline/expression/token.rb', line 19

def type
  @lexeme.type
end