Class: Shared::InstallationImage Abstract

Inherits:
Resource
  • Object
show all
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 inherited from Resource

#location, #security

Instance Method Summary collapse

Constructor Details

#initialize(location, client, installation_class) ⇒ InstallationImage

Returns a new instance of InstallationImage.



51
52
53
54
55
56
# File 'lib/vas/shared/installation_images.rb', line 51

def initialize(location, client, installation_class) #:nodoc:
  super(location, client)
  @version = details["version"]
  @size = details["size"]
  @installation_class = installation_class
end

Instance Attribute Details

#sizeInteger (readonly)

Returns the installation image’s size.

Returns:

  • (Integer)

    the installation image’s size



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

def size
  @size
end

#versionString (readonly)

Returns the installation image’s version.

Returns:

  • (String)

    the installation image’s version



45
46
47
# File 'lib/vas/shared/installation_images.rb', line 45

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



59
60
61
62
63
64
65
# File 'lib/vas/shared/installation_images.rb', line 59

def installations
  installations = []
  Util::LinkUtils.get_link_hrefs(client.get(location), "installation").each { |installation_location|
    installations << @installation_class.new(installation_location, client)
  }
  installations
end

#to_sString

Returns a string representation of the installation image.

Returns:

  • (String)

    a string representation of the installation image



68
69
70
# File 'lib/vas/shared/installation_images.rb', line 68

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