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

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

Overview

Entry that represents CI/CD variables.

Constant Summary

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::ComposableHash

#compose!

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

#[], #add_warning, #ancestors, #array?, 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



16
17
18
# File 'lib/gitlab/ci/config/entry/variables.rb', line 16

def self.default(**)
  {}
end

Instance Method Details

#valueObject



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

def value
  @entries.to_h do |key, entry|
    [key.to_s, entry.value]
  end
end

#value_with_dataObject



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

def value_with_data
  @entries.to_h do |key, entry|
    [key.to_s, entry.value_with_data]
  end
end

#value_with_prefill_dataObject



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

def value_with_prefill_data
  @entries.to_h do |key, entry|
    [key.to_s, entry.value_with_prefill_data]
  end
end