Class: Bosh::Director::Core::Templates::RenderedJobTemplate

Inherits:
Object
  • Object
show all
Defined in:
lib/bosh/director/core/templates/rendered_job_template.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, monit, templates) ⇒ RenderedJobTemplate

Returns a new instance of RenderedJobTemplate.



7
8
9
10
11
# File 'lib/bosh/director/core/templates/rendered_job_template.rb', line 7

def initialize(name, monit, templates)
  @name = name
  @monit = monit
  @templates = templates
end

Instance Attribute Details

#monitObject (readonly)

Returns the value of attribute monit.



5
6
7
# File 'lib/bosh/director/core/templates/rendered_job_template.rb', line 5

def monit
  @monit
end

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/bosh/director/core/templates/rendered_job_template.rb', line 5

def name
  @name
end

#templatesObject (readonly)

Returns the value of attribute templates.



5
6
7
# File 'lib/bosh/director/core/templates/rendered_job_template.rb', line 5

def templates
  @templates
end

Instance Method Details

#template_hashObject



13
14
15
16
17
18
19
20
21
# File 'lib/bosh/director/core/templates/rendered_job_template.rb', line 13

def template_hash
  template_digest = Digest::SHA1.new
  template_digest << monit
  templates.sort { |x, y| x.src_name <=> y.src_name }.each do |template_file|
    template_digest << template_file.contents
  end

  template_digest.hexdigest
end