Class: Teamlab::Group

Inherits:
Object
  • Object
show all
Includes:
GroupHelper
Defined in:
lib/teamlab/modules/group.rb

Instance Method Summary collapse

Methods included from GroupHelper

#info_by_name

Constructor Details

#initialize(config = nil) ⇒ Group

Returns a new instance of Group.



9
10
11
# File 'lib/teamlab/modules/group.rb', line 9

def initialize(config = nil)
  @request = Teamlab::Request.new(config, 'group')
end

Instance Method Details

#add_group(manager, name, members = []) ⇒ Object



21
22
23
# File 'lib/teamlab/modules/group.rb', line 21

def add_group(manager, name, members = [])
  @request.post('', groupManager: manager, groupName: name, members: members)
end

#add_group_users(group_id, members = []) ⇒ Object



33
34
35
# File 'lib/teamlab/modules/group.rb', line 33

def add_group_users(group_id, members = [])
  @request.put([group_id.to_s, 'members'], members: members)
end

#delete_group(group_id) ⇒ Object



45
46
47
# File 'lib/teamlab/modules/group.rb', line 45

def delete_group(group_id)
  @request.delete([group_id.to_s])
end

#get_group(group_id) ⇒ Object



17
18
19
# File 'lib/teamlab/modules/group.rb', line 17

def get_group(group_id)
  @request.get([group_id.to_s])
end

#get_groupsObject



13
14
15
# File 'lib/teamlab/modules/group.rb', line 13

def get_groups
  @request.get
end

#move_group_members(group_id, new_group_id) ⇒ Object



41
42
43
# File 'lib/teamlab/modules/group.rb', line 41

def move_group_members(group_id, new_group_id)
  @request.put([group_id.to_s, 'members', new_group_id.to_s])
end

#remove_group_members(group_id, members = []) ⇒ Object



49
50
51
# File 'lib/teamlab/modules/group.rb', line 49

def remove_group_members(group_id, members = [])
  @request.delete([group_id.to_s, 'members'], members: members)
end

#replace_members(group_id, members) ⇒ Object



25
26
27
# File 'lib/teamlab/modules/group.rb', line 25

def replace_members(group_id, members)
  @request.post([group_id.to_s, 'members'], members: members)
end

#set_group_manager(group_id, user_id) ⇒ Object



37
38
39
# File 'lib/teamlab/modules/group.rb', line 37

def set_group_manager(group_id, user_id)
  @request.put([group_id.to_s, 'manager'], userid: user_id)
end

#update_group(group_id, options = {}) ⇒ Object



29
30
31
# File 'lib/teamlab/modules/group.rb', line 29

def update_group(group_id, options = {})
  @request.put([group_id.to_s], options)
end