Class: Shared::Groups Abstract

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

Overview

This class is abstract.

A collection of groups

Instance Attribute Summary

Attributes inherited from Resource

#location, #security

Instance Method Summary collapse

Methods inherited from MutableCollection

#create_image

Methods inherited from Collection

#each, #reload

Constructor Details

#initialize(location, client, group_class) ⇒ Groups

Returns a new instance of Groups.



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

def initialize(location, client, group_class)
  super(location, client, 'groups', group_class)
end

Instance Method Details

#create(name, nodes) ⇒ Group

Creates a new group

Parameters:

  • name (String)

    the group’s name

  • nodes (GroupableNode[])

    the group’s nodes

Returns:

  • (Group)

    the new group



33
34
35
36
37
# File 'lib/vas/shared/groups.rb', line 33

def create(name, nodes)
  payload = {:name => name,
             :nodes => nodes.collect { |node| node.location }}
  super(payload, 'group')
end