blob: 375e6b4a96f4628c7e43338bedc3438d7f04b1f0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# frozen_string_literal: true
module Gitlab
module Ci
module Build
class Cache
include ::Gitlab::Utils::StrongMemoize
def initialize(cache, pipeline)
cache = Array.wrap(cache)
@cache = cache.map do |cache|
Gitlab::Ci::Pipeline::Seed::Build::Cache
.new(pipeline, cache)
end
end
def cache_attributes
strong_memoize(:cache_attributes) do
if @cache.empty?
{}
else
{ options: { cache: @cache.map(&:attributes) } }
end
end
end
end
end
end
end
|