Class: Shared::InstallationImage Abstract

Inherits:
Resource
  • Object
show all
Includes:
Deletable
Defined in:
lib/vas/shared/installation_images.rb

Overview

This class is abstract.

A product binary, typically are .zip or .tar.gz file, that has been uploaded to the server. Once created, an installation image can then be used to create an installation on a group.

Instance Attribute Summary collapse

Attributes included from Deletable

#collection

Attributes inherited from Resource

#location, #security

Instance Method Summary collapse

Methods included from Deletable

#delete

Constructor Details

#initialize(location, client, installation_class) ⇒ InstallationImage

Returns a new instance of InstallationImage.



53
54
55
56
57
58
59
60
# File 'lib/vas/shared/installation_images.rb', line 53

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

  @installation_class = installation_class

  @version = details['version']
  @size = details['size']
end

Instance Attribute Details

#sizeInteger (readonly)

Returns the installation image’s size.

Returns:

  • (Integer)

    the installation image’s size



50
51
52
# File 'lib/vas/shared/installation_images.rb', line 50

def size
  @size
end

#versionString (readonly)

Returns the installation image’s version.

Returns:

  • (String)

    the installation image’s version



47
48
49
# File 'lib/vas/shared/installation_images.rb', line 47

def version
  @version
end

Instance Method Details

#installationsInstallation[]

Returns the installations that have been created from the installation image.

Returns:

  • (Installation[])

    the installations that have been created from the installation image



71
72
73
# File 'lib/vas/shared/installation_images.rb', line 71

def installations
  @installations ||= create_resources_from_links('installation', @installation_class)
end

#reloadvoid

This method returns an undefined value.

Reloads the installation image’s details from the server



65
66
67
68
# File 'lib/vas/shared/installation_images.rb', line 65

def reload
  super
  @installations = nil
end

#to_sString

Returns a string representation of the installation image.

Returns:

  • (String)

    a string representation of the installation image



76
77
78
# File 'lib/vas/shared/installation_images.rb', line 76

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