Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/ci/pipeline/expression/lexeme/variable.rb')
-rw-r--r--lib/gitlab/ci/pipeline/expression/lexeme/variable.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/gitlab/ci/pipeline/expression/lexeme/variable.rb b/lib/gitlab/ci/pipeline/expression/lexeme/variable.rb
index 85c0899e4f6..11d2010909f 100644
--- a/lib/gitlab/ci/pipeline/expression/lexeme/variable.rb
+++ b/lib/gitlab/ci/pipeline/expression/lexeme/variable.rb
@@ -8,12 +8,12 @@ module Gitlab
class Variable < Lexeme::Value
PATTERN = /\$(?<name>\w+)/.freeze
- def initialize(name)
- @name = name
+ def evaluate(variables = {})
+ variables.with_indifferent_access.fetch(@value, nil)
end
- def evaluate(variables = {})
- variables.with_indifferent_access.fetch(@name, nil)
+ def inspect
+ "$#{@value}"
end
def self.build(string)