Class: Gitlab::Ci::Variables::Downstream::Generator

Inherits:
Object
  • Object
show all
Includes:
Utils::StrongMemoize
Defined in:
lib/gitlab/ci/variables/downstream/generator.rb

Defined Under Namespace

Classes: Context

Instance Method Summary collapse

Constructor Details

#initialize(bridge) ⇒ Generator

Returns a new instance of Generator.



12
13
14
15
16
17
18
19
# File 'lib/gitlab/ci/variables/downstream/generator.rb', line 12

def initialize(bridge)
  @bridge = bridge

  context = Context.new(all_bridge_variables: bridge.variables, expand_file_refs: bridge.expand_file_refs?)

  @raw_variable_generator = RawVariableGenerator.new(context)
  @expandable_variable_generator = ExpandableVariableGenerator.new(context)
end

Instance Method Details

#calculateObject



21
22
23
24
25
26
# File 'lib/gitlab/ci/variables/downstream/generator.rb', line 21

def calculate
  calculate_downstream_variables
    .reverse # variables priority
    .uniq { |var| var[:key] } # only one variable key to pass
    .reverse
end