Class: Shared::Group

Inherits:
Resource show all
Defined in:
lib/vas/shared/groups.rb

Direct Known Subclasses

RabbitMq::Group, MutableGroup

Instance Attribute Summary collapse

Attributes inherited from Resource

#location, #security

Instance Method Summary collapse

Constructor Details

#initialize(location, client, nodes_class, installations_class) ⇒ Group

:nodoc:#



43
44
45
46
47
48
# File 'lib/vas/shared/groups.rb', line 43

def initialize(location, client, nodes_class, installations_class) #:nodoc:#
  super(location, client)
  @name = details["name"]
  @installations = installations_class.new(Util::LinkUtils.get_link_href(details, "installations"), client)
  @nodes_class = nodes_class
end

Instance Attribute Details

#installationsObject (readonly)

The group’s installations



38
39
40
# File 'lib/vas/shared/groups.rb', line 38

def installations
  @installations
end

#nameObject (readonly)

The name of the group



41
42
43
# File 'lib/vas/shared/groups.rb', line 41

def name
  @name
end

Instance Method Details

#nodesObject

An array of the group’s nodes



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

def nodes
  nodes = []
  Util::LinkUtils.get_link_hrefs(client.get(location), "node").each { |node_location| nodes << @nodes_class.new(node_location, client)}
  nodes
end

#to_sObject

:nodoc:



57
58
59
# File 'lib/vas/shared/groups.rb', line 57

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