Class: Gitlab::Ci::Config::External::File::Template

Inherits:
Base
  • Object
show all
Defined in:
lib/gitlab/ci/config/external/file/template.rb

Constant Summary collapse

SUFFIX =
'.gitlab-ci.yml'

Constants inherited from Base

Base::YAML_WHITELIST_EXTENSION

Instance Attribute Summary collapse

Attributes inherited from Base

#context, #errors, #params

Instance Method Summary collapse

Methods inherited from Base

#error_message, #invalid_extension?, #invalid_location_type?, #matching?, #to_hash, #valid?

Methods included from Utils::StrongMemoize

#clear_memoization, #strong_memoize, #strong_memoized?

Constructor Details

#initialize(params, context) ⇒ Template

Returns a new instance of Template.


13
14
15
16
17
# File 'lib/gitlab/ci/config/external/file/template.rb', line 13

def initialize(params, context)
  @location = params[:template]

  super
end

Instance Attribute Details

#locationObject (readonly)

Returns the value of attribute location


9
10
11
# File 'lib/gitlab/ci/config/external/file/template.rb', line 9

def location
  @location
end

#projectObject (readonly)

Returns the value of attribute project


9
10
11
# File 'lib/gitlab/ci/config/external/file/template.rb', line 9

def project
  @project
end

Instance Method Details

#contentObject


19
20
21
# File 'lib/gitlab/ci/config/external/file/template.rb', line 19

def content
  strong_memoize(:content) { fetch_template_content }
end