Class: Gitlab::Ci::Variables::Builder::Project

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

Instance Method Summary collapse

Methods included from Utils::StrongMemoize

#clear_memoization, #strong_memoize, #strong_memoized?

Constructor Details

#initialize(project) ⇒ Project

Returns a new instance of Project.


10
11
12
# File 'lib/gitlab/ci/variables/builder/project.rb', line 10

def initialize(project)
  @project = project
end

Instance Method Details

#secret_variables(environment:, protected_ref: false) ⇒ Object


14
15
16
17
18
19
20
# File 'lib/gitlab/ci/variables/builder/project.rb', line 14

def secret_variables(environment:, protected_ref: false)
  variables = @project.variables
  variables = variables.unprotected unless protected_ref
  variables = variables.for_environment(environment)

  Gitlab::Ci::Variables::Collection.new(variables)
end