Class: Gitlab::Ci::Config::Entry::Variables

Inherits:
Gitlab::Config::Entry::Node show all
Includes:
Gitlab::Config::Entry::Validatable
Defined in:
lib/gitlab/ci/config/entry/variables.rb

Overview

Entry that represents environment variables.

Constant Summary collapse

ALLOWED_VALUE_DATA =
%i[value description].freeze

Constants inherited from Gitlab::Config::Entry::Node

Gitlab::Config::Entry::Node::InvalidError

Instance Attribute Summary

Attributes inherited from Gitlab::Config::Entry::Node

#config, #default, #deprecation, #description, #key, #metadata, #parent

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Gitlab::Config::Entry::Validatable

#compose!, #errors, included, #validate, #validator

Methods inherited from Gitlab::Config::Entry::Node

#[], #add_warning, #ancestors, aspects, #compose!, #descendants, #errors, #hash?, #initialize, #inspect, #integer?, #leaf?, #location, #opt, #relevant?, #specified?, #string?, #valid?, #warnings, with_aspect

Constructor Details

This class inherits a constructor from Gitlab::Config::Entry::Node

Class Method Details

.defaultObject


24
25
26
# File 'lib/gitlab/ci/config/entry/variables.rb', line 24

def self.default(**)
  {}
end

Instance Method Details

#use_value_data?Boolean

Returns:

  • (Boolean)

32
33
34
# File 'lib/gitlab/ci/config/entry/variables.rb', line 32

def use_value_data?
  opt(:use_value_data)
end

#valueObject


20
21
22
# File 'lib/gitlab/ci/config/entry/variables.rb', line 20

def value
  @config.to_h { |key, value| [key.to_s, expand_value(value)[:value]] }
end

#value_with_dataObject


28
29
30
# File 'lib/gitlab/ci/config/entry/variables.rb', line 28

def value_with_data
  @config.to_h { |key, value| [key.to_s, expand_value(value)] }
end