Class: Gitlab::Ci::Config::External::File::Artifact
- Extended by:
- Utils::Override
- Includes:
- Utils::StrongMemoize
- Defined in:
- lib/gitlab/ci/config/external/file/artifact.rb
Constant Summary
Constants inherited from Base
Base::YAML_WHITELIST_EXTENSION
Instance Attribute Summary collapse
-
#job_name ⇒ Object
readonly
Returns the value of attribute job_name.
Attributes inherited from Base
#context, #errors, #location, #params
Instance Method Summary collapse
- #content ⇒ Object
-
#initialize(params, context) ⇒ Artifact
constructor
A new instance of Artifact.
- #matching? ⇒ Boolean
Methods included from Utils::Override
extended, extensions, included, method_added, override, prepended, queue_verification, verify!
Methods included from Utils::StrongMemoize
#clear_memoization, #strong_memoize, #strong_memoized?
Methods inherited from Base
#error_message, #invalid_extension?, #invalid_location_type?, #to_hash, #valid?
Constructor Details
#initialize(params, context) ⇒ Artifact
Returns a new instance of Artifact.
14 15 16 17 18 19 |
# File 'lib/gitlab/ci/config/external/file/artifact.rb', line 14 def initialize(params, context) @location = params[:artifact] @job_name = params[:job] super end |
Instance Attribute Details
#job_name ⇒ Object (readonly)
Returns the value of attribute job_name
12 13 14 |
# File 'lib/gitlab/ci/config/external/file/artifact.rb', line 12 def job_name @job_name end |
Instance Method Details
#content ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/gitlab/ci/config/external/file/artifact.rb', line 21 def content strong_memoize(:content) do next unless artifact_job Gitlab::Ci::ArtifactFileReader.new(artifact_job).read(location) rescue Gitlab::Ci::ArtifactFileReader::Error => error errors.push(error.) end end |