Class: Gitlab::Ci::Pipeline::Expression::Token
- Inherits:
-
Object
- Object
- Gitlab::Ci::Pipeline::Expression::Token
- Defined in:
- lib/gitlab/ci/pipeline/expression/token.rb
Instance Attribute Summary collapse
-
#lexeme ⇒ Object
readonly
Returns the value of attribute lexeme.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #build(*args) ⇒ Object
-
#initialize(value, lexeme) ⇒ Token
constructor
A new instance of Token.
- #to_lexeme ⇒ Object
- #type ⇒ Object
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
#lexeme ⇒ Object (readonly)
Returns the value of attribute lexeme.
8 9 10 |
# File 'lib/gitlab/ci/pipeline/expression/token.rb', line 8 def lexeme @lexeme end |
#value ⇒ Object (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_lexeme ⇒ Object
23 24 25 |
# File 'lib/gitlab/ci/pipeline/expression/token.rb', line 23 def to_lexeme @lexeme.name.demodulize.downcase end |
#type ⇒ Object
19 20 21 |
# File 'lib/gitlab/ci/pipeline/expression/token.rb', line 19 def type @lexeme.type end |