Class: TcServer::Template

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

Overview

A tc Server template

Instance Attribute Summary collapse

Attributes inherited from Shared::Resource

#location, #security

Instance Method Summary collapse

Constructor Details

#initialize(location, client) ⇒ Template

Returns a new instance of Template.



54
55
56
57
58
59
60
61
62
63
# File 'lib/vas/tc_server/templates.rb', line 54

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

  @version = details["version"]
  @name = details["name"]
  @installation = Installation.new(Util::LinkUtils.get_link_href(details, 'installation'), client)

  template_image_location = Util::LinkUtils.get_link_href(details, "template-image")
  @template_image = TemplateImage.new(template_image_location, client) unless template_image_location.nil?
end

Instance Attribute Details

#installationInstallation (readonly)

Returns the template’s installation.

Returns:



51
52
53
# File 'lib/vas/tc_server/templates.rb', line 51

def installation
  @installation
end

#nameString (readonly)

Returns the template’s name.

Returns:

  • (String)

    the template’s name



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

def name
  @name
end

#template_imageTemplateImage (readonly)

Returns the template image, if any, that this template was created from.

Returns:

  • (TemplateImage)

    the template image, if any, that this template was created from



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

def template_image
  @template_image
end

#versionString (readonly)

Returns the template’s version.

Returns:

  • (String)

    the template’s version



42
43
44
# File 'lib/vas/tc_server/templates.rb', line 42

def version
  @version
end

Instance Method Details

#to_sString

Returns a string representation of the template.

Returns:

  • (String)

    a string representation of the template



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

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