Module: RedmineAPIHelper::GroupsAPIHelper

Included in:
Helpers
Defined in:
lib/redmine_api_helper/groups_api_helper.rb

Instance Method Summary collapse

Instance Method Details

#create_group(**params) ⇒ Object

creates a new group with params, corresponds to controller#create



54
55
56
# File 'lib/redmine_api_helper/groups_api_helper.rb', line 54

def create_group(**params)
  create_object(:group, params)
end

#destroy_group(id, **params) ⇒ Object

deletes an existing group with params, corresponds to controller#destroy



75
76
77
# File 'lib/redmine_api_helper/groups_api_helper.rb', line 75

def destroy_group(id, **params)
  destroy_object(:group, id, params)
end

#group_add_user(id, user_id, **params) ⇒ Object

updates an existing group with params, corresponds to controller#update



68
69
70
# File 'lib/redmine_api_helper/groups_api_helper.rb', line 68

def group_add_user(id, user_id, **params)
  jpost(params.merge(:user_id => user_id), :url => url_path(groups_url, id, "users"))
end

#group_url(id, **params) ⇒ Object

creates group_url



33
34
35
# File 'lib/redmine_api_helper/groups_api_helper.rb', line 33

def group_url(id, **params)
  url_path(groups_url, id, params)
end

#groups_url(**params) ⇒ Object

reads groups_url from args



26
27
28
# File 'lib/redmine_api_helper/groups_api_helper.rb', line 26

def groups_url(**params)
  url_path(args.urls.Home, "groups", params)
end

#list_groups(**params) ⇒ Object

lists groups, corresponds to controller#index



40
41
42
# File 'lib/redmine_api_helper/groups_api_helper.rb', line 40

def list_groups(**params)
  list_objects(:groups, params)
end

#read_group(id, **params) ⇒ Object

reads group having id, corresponds to controller#show



47
48
49
# File 'lib/redmine_api_helper/groups_api_helper.rb', line 47

def read_group(id, **params)
  read_object(:group, id, params)
end

#update_group(id, **params) ⇒ Object

updates an existing group with params, corresponds to controller#update



61
62
63
# File 'lib/redmine_api_helper/groups_api_helper.rb', line 61

def update_group(id, **params)
  update_object(:group, id, params)
end