Class: RabbitMq::PluginImage

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

Overview

A plugin image

Instance Attribute Summary collapse

Attributes inherited from Shared::Resource

#location, #security

Instance Method Summary collapse

Constructor Details

#initialize(location, client) ⇒ PluginImage

Returns a new instance of PluginImage.



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

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



42
43
44
# File 'lib/vas/rabbitmq/plugin_images.rb', line 42

def name
  @name
end

#sizeObject (readonly)

The plugin image’s size



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

def size
  @size
end

#versionObject (readonly)

The plugin image’s version



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

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



60
61
62
63
64
# File 'lib/vas/rabbitmq/plugin_images.rb', line 60

def plugins
  plugins = []
  Util::LinkUtils.get_link_hrefs(client.get(location), "plugin").each { |plugin_location| plugins << Plugin.new(plugin_location, client)}
  plugins
end

#to_sString

Returns a string representation of the plugin image.

Returns:

  • (String)

    a string representation of the plugin image



67
68
69
# File 'lib/vas/rabbitmq/plugin_images.rb', line 67

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