Class: Gitlab::Ci::Config::Entry::Cache

Inherits:
Gitlab::Config::Entry::Node show all
Includes:
Gitlab::Config::Entry::Attributable, Gitlab::Config::Entry::Configurable
Defined in:
lib/gitlab/ci/config/entry/cache.rb

Overview

Entry that represents a cache configuration

Constant Summary collapse

ALLOWED_KEYS =
%i[key untracked paths policy].freeze
DEFAULT_POLICY =
'pull-push'

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

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

Instance Attribute Summary

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

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

Instance Method Summary collapse

Methods included from Gitlab::Config::Entry::Configurable

#compose!, #entry_create!, #skip_config_hash_validation?

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

#[], #add_warning, #ancestors, aspects, #compose!, default, #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

Instance Method Details

#valueObject


33
34
35
36
37
38
39
40
# File 'lib/gitlab/ci/config/entry/cache.rb', line 33

def value
  result = super

  result[:key] = key_value
  result[:policy] = policy || DEFAULT_POLICY

  result
end