Module: Connect::WebService::Rest
- Includes:
- ConnectParameters::ParamsFactory, Request
- Included in:
- Client
- Defined in:
- lib/connect/web_service/rest.rb
Instance Method Summary collapse
- #add_param(params, param) ⇒ Object
- #client_user_read(options = {}) ⇒ Object
- #department_add(options) ⇒ Object
- #department_delete(options) ⇒ Object
- #department_edit(options) ⇒ Object
- #department_read(options = {}) ⇒ Object
- #region_read ⇒ Object
- #specialist_add(options) ⇒ Object
- #specialist_read(options = {}) ⇒ Object
Methods included from ConnectParameters::ParamsFactory
#create_changed_from, #create_date, #create_date_time, #create_parameter, #create_string
Methods included from Request
Instance Method Details
#add_param(params, param) ⇒ Object
66 67 68 |
# File 'lib/connect/web_service/rest.rb', line 66 def add_param(params, param) params << param if param.required || param.value.content end |
#client_user_read(options = {}) ⇒ Object
59 60 61 62 63 64 |
# File 'lib/connect/web_service/rest.rb', line 59 def client_user_read( = {}) params = [] add_param(params, create_changed_from()) add_param(params, create_string(name: 'ClientID', content: [:client_id])) call(self, method: :client_user_read, params: params) end |
#department_add(options) ⇒ Object
19 20 21 22 23 |
# File 'lib/connect/web_service/rest.rb', line 19 def department_add() params = [] add_param(params, create_string(name: 'Name', content: [:name], required: true)) call(self, method: :department_add, params: params) end |
#department_delete(options) ⇒ Object
32 33 34 35 36 |
# File 'lib/connect/web_service/rest.rb', line 32 def department_delete() params = [] add_param(params, create_string(name: 'DepartmentID', content: [:department_id], required: true)) call(self, method: :department_delete, params: params) end |
#department_edit(options) ⇒ Object
25 26 27 28 29 30 |
# File 'lib/connect/web_service/rest.rb', line 25 def department_edit() params = [] add_param(params, create_string(name: 'DepartmentID', content: [:department_id], required: true)) add_param(params, create_string(name: 'Name', content: [:name])) call(self, method: :department_edit, params: params) end |
#department_read(options = {}) ⇒ Object
13 14 15 16 17 |
# File 'lib/connect/web_service/rest.rb', line 13 def department_read( = {}) params = [] add_param(params, create_changed_from()) call(self, method: :department_read, params: params) end |
#region_read ⇒ Object
9 10 11 |
# File 'lib/connect/web_service/rest.rb', line 9 def region_read call(self, method: :region_read) end |
#specialist_add(options) ⇒ Object
44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/connect/web_service/rest.rb', line 44 def specialist_add() params = [] add_param(params, create_string(name: 'Name', content: [:name], required: true)) add_param(params, create_string(name: 'email', content: [:email], required: true)) add_param(params, create_string(name: 'Surname', content: [:surname])) add_param(params, create_string(name: 'SecondaryName', content: [:secondary_name])) add_param(params, create_string(name: 'Password', content: [:password])) add_param(params, create_date(name: 'Birthday', content: [:birthday])) add_param(params, create_string(name: 'Post', content: [:post])) add_param(params, create_string(name: 'DepartmentID', content: [:department_id])) add_param(params, create_string(name: 'Phone', content: [:phone])) call(self, method: :specialist_add, params: params) end |
#specialist_read(options = {}) ⇒ Object
38 39 40 41 42 |
# File 'lib/connect/web_service/rest.rb', line 38 def specialist_read( = {}) params = [] add_param(params, create_changed_from()) call(self, method: :specialist_read, params: params) end |