summaryrefslogtreecommitdiff
path: root/lib/gitlab/ci/config/entry/variables.rb
blob: 0284958d9d4a458036c76cfbc4a01f151f54ed4c (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
# frozen_string_literal: true

module Gitlab
  module Ci
    class Config
      module Entry
        ##
        # Entry that represents CI/CD variables.
        # CurrentVariables will be renamed to this class when removing the FF `ci_variables_refactoring_to_variable`.
        #
        class Variables
          def self.new(...)
            if YamlProcessor::FeatureFlags.enabled?(:ci_variables_refactoring_to_variable)
              CurrentVariables.new(...)
            else
              LegacyVariables.new(...)
            end
          end

          def self.default(**)
            {}
          end
        end
      end
    end
  end
end