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

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, options = {})
  @request.post(['task', task_id.to_s, 'time'], { date: date, personId: person_id, projectId: project_id }.merge(options))
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(options = {})
  @request.get(%w[time filter], options)
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(options = {})
  @request.get(%w[time filter total], options)
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, options = {})
  @request.put(['time', time_id.to_s], { date: date, personId: person_id }.merge(options))
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