Class: Teamlab::Group

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

Instance Method Summary collapse

Constructor Details

#initializeGroup

Returns a new instance of Group.



3
4
5
# File 'lib/teamlab/modules/group.rb', line 3

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

Instance Method Details

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



15
16
17
# File 'lib/teamlab/modules/group.rb', line 15

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

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



27
28
29
# File 'lib/teamlab/modules/group.rb', line 27

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

#delete_group(group_id) ⇒ Object



39
40
41
# File 'lib/teamlab/modules/group.rb', line 39

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

#get_group(group_id) ⇒ Object



11
12
13
# File 'lib/teamlab/modules/group.rb', line 11

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

#get_groupsObject



7
8
9
# File 'lib/teamlab/modules/group.rb', line 7

def get_groups
  @request.get
end

#move_group_members(group_id, new_group_id) ⇒ Object



35
36
37
# File 'lib/teamlab/modules/group.rb', line 35

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



43
44
45
# File 'lib/teamlab/modules/group.rb', line 43

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

#replace_members(group_id, members) ⇒ Object



19
20
21
# File 'lib/teamlab/modules/group.rb', line 19

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

#set_group_manager(group_id, user_id) ⇒ Object



31
32
33
# File 'lib/teamlab/modules/group.rb', line 31

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



23
24
25
# File 'lib/teamlab/modules/group.rb', line 23

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