Class: Shared::Groups

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

Instance Attribute Summary

Attributes inherited from Resource

#location, #security

Instance Method Summary collapse

Methods inherited from MutableCollection

#delete

Methods inherited from Collection

#each

Constructor Details

#initialize(location, client, group_class) ⇒ Groups

:nodoc:



22
23
24
# File 'lib/vas/shared/groups.rb', line 22

def initialize(location, client, group_class) #:nodoc:
  super(location, client, "groups", group_class)
end

Instance Method Details

#create(name, nodes) ⇒ Object

Creates a Group named name from the given nodes.



27
28
29
30
31
# File 'lib/vas/shared/groups.rb', line 27

def create(name, nodes)
  node_locations = []
  nodes.each { |node| node_locations << node.location }
  entry_class.new(client.post(location, {:name => name, :nodes => node_locations}, "group"), client)
end