Class: Shared::GroupableNode Abstract

Inherits:
Node show all
Defined in:
lib/vas/shared/nodes.rb

Overview

This class is abstract.

A node that can be grouped

Direct Known Subclasses

Gemfire::Node, RabbitMq::Node, TcServer::Node

Instance Attribute Summary

Attributes inherited from Node

#agent_home, #architecture, #host_names, #ip_addresses, #metadata, #operating_system

Attributes inherited from Resource

#location, #security

Instance Method Summary collapse

Constructor Details

#initialize(location, client, group_class) ⇒ GroupableNode

Returns a new instance of GroupableNode.



58
59
60
61
# File 'lib/vas/shared/nodes.rb', line 58

def initialize(location, client, group_class)
  super(location, client)
  @group_class = group_class
end

Instance Method Details

#groupsGroup[]

Returns the groups that contain this node.

Returns:

  • (Group[])

    the groups that contain this node



64
65
66
67
68
69
# File 'lib/vas/shared/nodes.rb', line 64

def groups
  groups = []
  Util::LinkUtils.get_link_hrefs(client.get(location), 'group').each {
      |group_location| groups << @group_class.new(group_location, client)}
  groups
end