gitlab-org--gitlab-foss/lib/gitlab/ci/pipeline/expression/token.rb

29 lines
505 B
Ruby
Raw Normal View History

2018-02-21 06:37:55 -05:00
module Gitlab
module Ci
module Pipeline
module Expression
class Token
attr_reader :value, :lexeme
def initialize(value, lexeme)
2018-02-21 06:37:55 -05:00
@value = value
@lexeme = lexeme
2018-02-21 06:37:55 -05:00
end
def build(*args)
@lexeme.build(@value, *args)
end
def type
@lexeme.type
2018-02-21 07:38:37 -05:00
end
2018-02-21 06:37:55 -05:00
def to_lexeme
@lexeme.name.demodulize.downcase
2018-02-21 06:37:55 -05:00
end
end
end
end
end
end