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

:nodoc:



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

def initialize(location, client) #:nodoc:
  super(location, client)

  @version = details["version"]
  @name = details["name"]

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

  @installation = Installation.new(Util::LinkUtils.get_link_href(details, 'installation'), client)

end

Instance Attribute Details

#installationObject (readonly)

The template’s installation



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

def installation
  @installation
end

#nameObject (readonly)

The template’s name



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

def name
  @name
end

#template_imageObject (readonly)

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



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

def template_image
  @template_image
end

#versionObject (readonly)

The template’s version



38
39
40
# File 'lib/vas/tc_server/templates.rb', line 38

def version
  @version
end

Instance Method Details

#to_sObject

:nodoc:



64
65
66
# File 'lib/vas/tc_server/templates.rb', line 64

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