Class: TcServer::Template
- Inherits:
-
Shared::Resource
- Object
- Shared::Resource
- TcServer::Template
- Includes:
- Shared::Deletable
- Defined in:
- lib/vas/tc_server/templates.rb
Overview
A tc Server template
Instance Attribute Summary collapse
-
#name ⇒ String
readonly
The template’s name.
-
#version ⇒ String
readonly
The template’s version.
Attributes included from Shared::Deletable
Attributes inherited from Shared::Resource
Instance Method Summary collapse
-
#initialize(location, client) ⇒ Template
constructor
A new instance of Template.
-
#installation ⇒ Installation
The template’s installation.
-
#template_image ⇒ TemplateImage
The template image, if any, that this template was created from.
-
#to_s ⇒ String
A string representation of the template.
Methods included from Shared::Deletable
Constructor Details
#initialize(location, client) ⇒ Template
Returns a new instance of 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
#name ⇒ String (readonly)
Returns the template’s name.
47 48 49 |
# File 'lib/vas/tc_server/templates.rb', line 47 def name @name end |
#version ⇒ String (readonly)
Returns the template’s version.
44 45 46 |
# File 'lib/vas/tc_server/templates.rb', line 44 def version @version end |
Instance Method Details
#installation ⇒ Installation
Returns the template’s installation.
61 62 63 |
# File 'lib/vas/tc_server/templates.rb', line 61 def installation @installation ||= Installation.new(@installation_location, client) end |
#template_image ⇒ TemplateImage
Returns the template image, if any, that this template was created from.
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_s ⇒ String
Returns a string representation of the template.
74 75 76 |
# File 'lib/vas/tc_server/templates.rb', line 74 def to_s "#<#{self.class} name='#@name' version='#@version'>" end |