Class: Shared::Installation Abstract

Inherits:
Resource show all
Includes:
Deletable
Defined in:
lib/vas/shared/installations.rb

Overview

This class is abstract.

An installation of a middleware component. Created from an installation image. Once created, an installation is used when creating a new instance and provides the binaries that the instance uses at runtime

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_image_class, group_class) ⇒ Installation

Returns a new instance of Installation.



49
50
51
52
53
54
55
56
57
58
59
# File 'lib/vas/shared/installations.rb', line 49

def initialize(location, client, installation_image_class, group_class)
  super(location, client)

  @installation_image_location = Util::LinkUtils.get_link_href(details, 'installation-image')
  @group_location = Util::LinkUtils.get_link_href(details, 'group')

  @installation_image_class = installation_image_class
  @group_class = group_class

  @version = details['version']
end

Instance Attribute Details

#versionString (readonly)

Returns the installation’s version.

Returns:

  • (String)

    the installation’s version



46
47
48
# File 'lib/vas/shared/installations.rb', line 46

def version
  @version
end

Instance Method Details

#groupGroup

Returns the group that contains the installation.

Returns:

  • (Group)

    the group that contains the installation



62
63
64
# File 'lib/vas/shared/installations.rb', line 62

def group
  @group ||= @group_class.new(@group_location, client)
end

#installation_imageInstallationImage

Returns the installation image that was used to create the installation.

Returns:

  • (InstallationImage)

    the installation image that was used to create the installation



67
68
69
# File 'lib/vas/shared/installations.rb', line 67

def installation_image
  @installation_image ||= @installation_image_class.new(@installation_image_location, client)
end

#to_sString

Returns a string representation of the installation.

Returns:

  • (String)

    a string representation of the installation



72
73
74
# File 'lib/vas/shared/installations.rb', line 72

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