Class: TcServer::Template
- Inherits:
-
Shared::Resource
- Object
- Shared::Resource
- TcServer::Template
- Defined in:
- lib/vas/tc_server/templates.rb
Overview
A tc Server template
Instance Attribute Summary collapse
-
#installation ⇒ Installation
readonly
The template’s installation.
-
#name ⇒ String
readonly
The template’s name.
-
#template_image ⇒ TemplateImage
readonly
The template image, if any, that this template was created from.
-
#version ⇒ String
readonly
The template’s version.
Attributes inherited from Shared::Resource
Instance Method Summary collapse
-
#initialize(location, client) ⇒ Template
constructor
A new instance of Template.
-
#to_s ⇒ String
A string representation of the template.
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
#installation ⇒ Installation (readonly)
Returns the template’s installation.
51 52 53 |
# File 'lib/vas/tc_server/templates.rb', line 51 def installation @installation end |
#name ⇒ String (readonly)
Returns the template’s name.
45 46 47 |
# File 'lib/vas/tc_server/templates.rb', line 45 def name @name end |
#template_image ⇒ TemplateImage (readonly)
Returns 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 |
#version ⇒ String (readonly)
Returns the template’s version.
42 43 44 |
# File 'lib/vas/tc_server/templates.rb', line 42 def version @version end |
Instance Method Details
#to_s ⇒ String
Returns 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 |