Class: TcServer::Template

Inherits:
Shared::Resource show all
Includes:
Shared::Deletable
Defined in:
lib/vas/tc_server/templates.rb

Overview

A tc Server template

Instance Attribute Summary collapse

Attributes included from Shared::Deletable

#collection

Attributes inherited from Shared::Resource

#location, #security

Instance Method Summary collapse

Methods included from Shared::Deletable

#delete

Constructor Details

#initialize(location, client) ⇒ Template



50
51
52
53
54
55
56
57
58
# File 'lib/vas/tc_server/templates.rb', line 50

def initialize(location, client)
  super(location, client)

  @version = details['version']
  @name = details['name']

  @installation_location = Util::LinkUtils.get_link_href(details, 'installation')
  @template_image_location = Util::LinkUtils.get_link_href(details, 'template-image')
end

Instance Attribute Details

#nameString (readonly)



47
48
49
# File 'lib/vas/tc_server/templates.rb', line 47

def name
  @name
end

#versionString (readonly)



44
45
46
# File 'lib/vas/tc_server/templates.rb', line 44

def version
  @version
end

Instance Method Details

#installationInstallation



61
62
63
# File 'lib/vas/tc_server/templates.rb', line 61

def installation
  @installation ||= Installation.new(@installation_location, client)
end

#template_imageTemplateImage



66
67
68
69
70
71
# File 'lib/vas/tc_server/templates.rb', line 66

def template_image
  if @template_image.nil?
    @template_image = TemplateImage.new(@template_image_location, client) unless @template_image_location.nil?
  end
  @template_image
end

#to_sString



74
75
76
# File 'lib/vas/tc_server/templates.rb', line 74

def to_s
  "#<#{self.class} name='#@name' version='#@version'>"
end