Class: Gitlab::Ci::Build::Context::Build

Inherits:
Base
  • Object
show all
Includes:
Utils::StrongMemoize
Defined in:
lib/gitlab/ci/build/context/build.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#pipeline

Instance Method Summary collapse

Methods included from Utils::StrongMemoize

#clear_memoization, #strong_memoize, #strong_memoized?

Constructor Details

#initialize(pipeline, attributes = {}) ⇒ Build

Returns a new instance of Build.


12
13
14
15
16
# File 'lib/gitlab/ci/build/context/build.rb', line 12

def initialize(pipeline, attributes = {})
  super(pipeline)

  @attributes = attributes
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes


10
11
12
# File 'lib/gitlab/ci/build/context/build.rb', line 10

def attributes
  @attributes
end

Instance Method Details

#variablesObject


18
19
20
21
22
23
24
25
26
# File 'lib/gitlab/ci/build/context/build.rb', line 18

def variables
  strong_memoize(:variables) do
    # This is a temporary piece of technical debt to allow us access
    # to the CI variables to evaluate rules before we persist a Build
    # with the result. We should refactor away the extra Build.new,
    # but be able to get CI Variables directly from the Seed::Build.
    stub_build.scoped_variables_hash
  end
end