Class: MustardClient::TeamsClient

Inherits:
Client
  • Object
show all
Defined in:
lib/MustardClient/teams.rb

Instance Method Summary collapse

Methods inherited from Client

#execute, #initialize

Constructor Details

This class inherits a constructor from MustardClient::Client

Instance Method Details

#add(team_params) ⇒ Object



27
28
29
30
31
32
33
34
35
36
37
# File 'lib/MustardClient/teams.rb', line 27

def add team_params

  command = {}
  command[:method] = :post
  command[:route] = @mustard_url + "/teams"
  command[:params] = {team: team_params}
  command[:headers] = {'User-Token' => @user_token}

  execute(command)

end

#add_project(team_id, project_id) ⇒ Object



73
74
75
76
77
78
79
80
81
82
# File 'lib/MustardClient/teams.rb', line 73

def add_project team_id, project_id

  command = {}
  command[:method] = :post
  command[:route] = @mustard_url + "/teams/#{team_id}/project/#{ project_id }"
  command[:headers] = {'User-Token' => @user_token}

  execute(command)

end

#add_user(team_id, user_id) ⇒ Object



62
63
64
65
66
67
68
69
70
71
# File 'lib/MustardClient/teams.rb', line 62

def add_user team_id, user_id

  command = {}
  command[:method] = :post
  command[:route] = @mustard_url + "/teams/#{team_id}/user/#{ user_id }"
  command[:headers] = {'User-Token' => @user_token}

  execute(command)

end

#allObject



5
6
7
8
9
10
11
12
13
14
# File 'lib/MustardClient/teams.rb', line 5

def all

  command = {}
  command[:method] = :get
  command[:route] = @mustard_url + '/teams'
  command[:headers] = {'User-Token' => @user_token}

  execute(command)

end

#delete(team_id) ⇒ Object



39
40
41
42
43
44
45
46
47
48
# File 'lib/MustardClient/teams.rb', line 39

def delete team_id

  command = {}
  command[:method] = :delete
  command[:route] = @mustard_url + "/teams/#{team_id}"
  command[:headers] = {'User-Token' => @user_token}

  execute(command)

end

#find(team_id) ⇒ Object



16
17
18
19
20
21
22
23
24
25
# File 'lib/MustardClient/teams.rb', line 16

def find team_id

  command = {}
  command[:method] = :get
  command[:route] = @mustard_url + "/teams/#{team_id}"
  command[:headers] = {'User-Token' => @user_token}

  execute(command)

end

#remove_project(team_id, project_id) ⇒ Object



95
96
97
98
99
100
101
102
103
104
# File 'lib/MustardClient/teams.rb', line 95

def remove_project team_id, project_id

  command = {}
  command[:method] = :delete
  command[:route] = @mustard_url + "/teams/#{team_id}/project/#{ project_id }"
  command[:headers] = {'User-Token' => @user_token}

  execute(command)

end

#remove_user(team_id, user_id) ⇒ Object



84
85
86
87
88
89
90
91
92
93
# File 'lib/MustardClient/teams.rb', line 84

def remove_user team_id, user_id

  command = {}
  command[:method] = :delete
  command[:route] = @mustard_url + "/teams/#{team_id}/user/#{ user_id }"
  command[:headers] = {'User-Token' => @user_token}

  execute(command)

end

#update(team_id, team_params) ⇒ Object



50
51
52
53
54
55
56
57
58
59
60
# File 'lib/MustardClient/teams.rb', line 50

def update team_id, team_params

  command = {}
  command[:method] = :put
  command[:route] = @mustard_url + "/teams/#{team_id}"
  command[:headers] = {'User-Token' => @user_token}
  command[:params] = {team: team_params}

  execute(command)

end