Class: School21::ParticipantsApi
- Inherits:
-
BaseApi
- Object
- BaseApi
- School21::ParticipantsApi
show all
- Defined in:
- lib/school21/api/participants_api.rb
Constant Summary
Constants inherited
from BaseApi
BaseApi::PLATFORM_AUTH_PARTICIPANT
Instance Method Summary
collapse
Methods inherited from BaseApi
base_uri, #execute_request, #initialize, #new_api_call_builder, #new_parameter, #new_request_builder, #new_response_handler, #request_with_auth_participant, response_convertor
Instance Method Details
#participant(login) ⇒ Object
5
6
7
8
9
10
|
# File 'lib/school21/api/participants_api.rb', line 5
def participant(login)
path = ['/participants/', login].join
new_request = request_with_auth_participant(HttpMethod::GET, path, :api_v1)
execute_request(new_request)
end
|
#participant_badges(login) ⇒ Object
99
100
101
102
103
104
|
# File 'lib/school21/api/participants_api.rb', line 99
def participant_badges(login)
path = ['/participants/', login, '/badges'].join
new_request = request_with_auth_participant(HttpMethod::GET, path, :api_v1)
execute_request(new_request)
end
|
#participant_coalition(login) ⇒ Object
92
93
94
95
96
97
|
# File 'lib/school21/api/participants_api.rb', line 92
def participant_coalition(login)
path = ['/participants/', login, '/coalition'].join
new_request = request_with_auth_participant(HttpMethod::GET, path, :api_v1)
execute_request(new_request)
end
|
#participant_course(login, course_id) ⇒ Object
85
86
87
88
89
90
|
# File 'lib/school21/api/participants_api.rb', line 85
def participant_course(login, course_id)
path = ['/participants/', login, '/courses/', course_id].join
new_request = request_with_auth_participant(HttpMethod::GET, path, :api_v1)
execute_request(new_request)
end
|
#participant_courses(login, options: {}) ⇒ Object
73
74
75
76
77
78
79
80
81
82
83
|
# File 'lib/school21/api/participants_api.rb', line 73
def participant_courses(login, options: {})
path = ['/participants/', login, '/courses'].join
default_options = { limit: 10, offset: 0 }.merge(options)
new_request = request_with_auth_participant(HttpMethod::GET, path, :api_v1)
default_options.each do |key, value|
new_request.query_param(new_parameter(value, key:))
end
execute_request(new_request)
end
|
#participant_experience_history(login, options: {}) ⇒ Object
61
62
63
64
65
66
67
68
69
70
71
|
# File 'lib/school21/api/participants_api.rb', line 61
def participant_experience_history(login, options: {})
path = ['/participants/', login, '/experience-history'].join
default_options = { limit: 50, offset: 0 }.merge(options)
new_request = request_with_auth_participant(HttpMethod::GET, path, :api_v1)
default_options.each do |key, value|
new_request.query_param(new_parameter(value, key:))
end
execute_request(new_request)
end
|
#participant_feedback(login) ⇒ Object
54
55
56
57
58
59
|
# File 'lib/school21/api/participants_api.rb', line 54
def participant_feedback(login)
path = ['/participants/', login, '/feedback'].join
new_request = request_with_auth_participant(HttpMethod::GET, path, :api_v1)
execute_request(new_request)
end
|
#participant_logtime(login, date: nil) ⇒ Object
45
46
47
48
49
50
51
52
|
# File 'lib/school21/api/participants_api.rb', line 45
def participant_logtime(login, date: nil)
path = ['/participants/', login, '/logtime'].join
new_request = request_with_auth_participant(HttpMethod::GET, path, :api_v1)
new_request.query_param(new_parameter(date, key: :date)) if date.present?
execute_request(new_request)
end
|
#participant_points(login) ⇒ Object
38
39
40
41
42
43
|
# File 'lib/school21/api/participants_api.rb', line 38
def participant_points(login)
path = ['/participants/', login, '/points'].join
new_request = request_with_auth_participant(HttpMethod::GET, path, :api_v1)
execute_request(new_request)
end
|
#participant_project(login, project_id) ⇒ Object
31
32
33
34
35
36
|
# File 'lib/school21/api/participants_api.rb', line 31
def participant_project(login, project_id)
path = ['/participants/', login, '/projects/', project_id].join
new_request = request_with_auth_participant(HttpMethod::GET, path, :api_v1)
execute_request(new_request)
end
|
#participant_projects(login, options: {}) ⇒ Object
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/school21/api/participants_api.rb', line 19
def participant_projects(login, options: {})
path = ['/participants/', login, '/projects'].join
default_options = { limit: 10, offset: 0 }.merge(options)
new_request = request_with_auth_participant(HttpMethod::GET, path, :api_v1)
default_options.each do |key, value|
new_request.query_param(new_parameter(value, key:))
end
execute_request(new_request)
end
|
#participant_skills(login) ⇒ Object
106
107
108
109
110
111
|
# File 'lib/school21/api/participants_api.rb', line 106
def participant_skills(login)
path = ['/participants/', login, '/skills'].join
new_request = request_with_auth_participant(HttpMethod::GET, path, :api_v1)
execute_request(new_request)
end
|
#participant_workstation(login) ⇒ Object
12
13
14
15
16
17
|
# File 'lib/school21/api/participants_api.rb', line 12
def participant_workstation(login)
path = ['/participants/', login, '/workstation'].join
new_request = request_with_auth_participant(HttpMethod::GET, path, :api_v1)
execute_request(new_request)
end
|