Module: Teamlab::ProjectsTime
- Included in:
- Project
- Defined in:
- lib/teamlab/modules/projects/projects_time.rb
Overview
Module for projects time methods
Instance Method Summary collapse
- #add_task_time(task_id, date, person_id, project_id, options = {}) ⇒ Object
- #delete_time_spents(*time_ids) ⇒ Object
- #get_time_spent(task_id) ⇒ Object
- #get_time_spent_by_filter(options = {}) ⇒ Object
- #get_total_time_spent_by_filter(options = {}) ⇒ Object
- #update_task_time(time_id, date, person_id, options = {}) ⇒ Object
- #update_time_status_of_payment(time_ids, status) ⇒ Object
Instance Method Details
#add_task_time(task_id, date, person_id, project_id, options = {}) ⇒ Object
18 19 20 |
# File 'lib/teamlab/modules/projects/projects_time.rb', line 18 def add_task_time(task_id, date, person_id, project_id, = {}) @request.post(['task', task_id.to_s, 'time'], { date: date, personId: person_id, projectId: project_id }.merge()) end |
#delete_time_spents(*time_ids) ⇒ Object
30 31 32 |
# File 'lib/teamlab/modules/projects/projects_time.rb', line 30 def delete_time_spents(*time_ids) @request.delete(%w[time times remove], timeIds: time_ids.flatten) end |
#get_time_spent(task_id) ⇒ Object
14 15 16 |
# File 'lib/teamlab/modules/projects/projects_time.rb', line 14 def get_time_spent(task_id) @request.get(['task', task_id.to_s, 'time']) end |
#get_time_spent_by_filter(options = {}) ⇒ Object
6 7 8 |
# File 'lib/teamlab/modules/projects/projects_time.rb', line 6 def get_time_spent_by_filter( = {}) @request.get(%w[time filter], ) end |
#get_total_time_spent_by_filter(options = {}) ⇒ Object
10 11 12 |
# File 'lib/teamlab/modules/projects/projects_time.rb', line 10 def get_total_time_spent_by_filter( = {}) @request.get(%w[time filter total], ) end |
#update_task_time(time_id, date, person_id, options = {}) ⇒ Object
22 23 24 |
# File 'lib/teamlab/modules/projects/projects_time.rb', line 22 def update_task_time(time_id, date, person_id, = {}) @request.put(['time', time_id.to_s], { date: date, personId: person_id }.merge()) end |
#update_time_status_of_payment(time_ids, status) ⇒ Object
26 27 28 |
# File 'lib/teamlab/modules/projects/projects_time.rb', line 26 def update_time_status_of_payment(time_ids, status) @request.put(%w[time times status], timeids: time_ids, status: status) end |