Class: RabbitMq::PluginImage

Inherits:
Shared::Resource show all
Includes:
Shared::Deletable
Defined in:
lib/vas/rabbitmq/plugin_images.rb

Overview

A plugin image

Instance Attribute Summary collapse

Attributes included from Shared::Deletable

#collection

Attributes inherited from Shared::Resource

#location, #security

Instance Method Summary collapse

Methods included from Shared::Deletable

#delete

Constructor Details

#initialize(location, client) ⇒ PluginImage

Returns a new instance of PluginImage.



53
54
55
56
57
58
59
# File 'lib/vas/rabbitmq/plugin_images.rb', line 53

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

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

Instance Attribute Details

#nameObject (readonly)

The plugin image’s name



44
45
46
# File 'lib/vas/rabbitmq/plugin_images.rb', line 44

def name
  @name
end

#sizeObject (readonly)

The plugin image’s size



50
51
52
# File 'lib/vas/rabbitmq/plugin_images.rb', line 50

def size
  @size
end

#versionObject (readonly)

The plugin image’s version



47
48
49
# File 'lib/vas/rabbitmq/plugin_images.rb', line 47

def version
  @version
end

Instance Method Details

#pluginsPlugin[]

Returns the plugins that have been created from this plugin image.

Returns:

  • (Plugin[])

    the plugins that have been created from this plugin image



69
70
71
# File 'lib/vas/rabbitmq/plugin_images.rb', line 69

def plugins
  @plugins ||= create_resources_from_links('plugin', Plugin)
end

#reloadvoid

This method returns an undefined value.

Reloads the plugin image’s details from the server



63
64
65
66
# File 'lib/vas/rabbitmq/plugin_images.rb', line 63

def reload
  super
  @plugins = nil
end

#to_sString

Returns a string representation of the plugin image.

Returns:

  • (String)

    a string representation of the plugin image



74
75
76
# File 'lib/vas/rabbitmq/plugin_images.rb', line 74

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