Module: Teamlab::ProjectsMilestones
- Included in:
- Project
- Defined in:
- lib/teamlab/modules/projects/projects_milestones.rb
Overview
Module for projects milestones methods
Instance Method Summary collapse
-
#add_milestone(project_id, title, deadline, responsible_id, options = {}) ⇒ Hash
Adds a new milestone using the parameters (project ID, milestone title, deadline, etc) specified in the request.
- #delete_milestone(id) ⇒ Object
-
#delete_milestones(ids) ⇒ Array
Deletes the milestones with the IDs specified in the request.
- #get_milestone(id) ⇒ Object
- #get_milestone_tasks(id) ⇒ Object
- #get_milestones_by_filter(options = {}) ⇒ Object
- #get_milestones_by_full_date(year, month, day) ⇒ Object
- #get_milestones_by_month(year, month) ⇒ Object
- #get_overdue_milestones ⇒ Object
- #get_upcoming_milestones ⇒ Object
-
#milestones_by_project_id(project_id) ⇒ Array
Returns a list of all the milestones within a project with the ID specified in the request.
-
#milestones_by_project_id_and_status(project_id, status) ⇒ Array
Returns a list of all the milestones within a project with the ID and status specified in the request.
- #update_milestone(id, title, deadline, options = {}) ⇒ Object
- #update_milestone_status(id, status) ⇒ Object
Instance Method Details
#add_milestone(project_id, title, deadline, responsible_id, options = {}) ⇒ Hash
Adds a new milestone using the parameters (project ID, milestone title, deadline, etc) specified in the request
60 61 62 |
# File 'lib/teamlab/modules/projects/projects_milestones.rb', line 60 def add_milestone(project_id, title, deadline, responsible_id, = {}) @request.post([project_id.to_s, 'milestone'], { title: title, deadline: deadline, responsible: responsible_id }.merge()) end |
#delete_milestone(id) ⇒ Object
72 73 74 |
# File 'lib/teamlab/modules/projects/projects_milestones.rb', line 72 def delete_milestone(id) @request.delete(['milestone', id.to_s]) end |
#delete_milestones(ids) ⇒ Array
Deletes the milestones with the IDs specified in the request
79 80 81 |
# File 'lib/teamlab/modules/projects/projects_milestones.rb', line 79 def delete_milestones(ids) @request.delete(['milestone'], { ids: ids }) end |
#get_milestone(id) ⇒ Object
14 15 16 |
# File 'lib/teamlab/modules/projects/projects_milestones.rb', line 14 def get_milestone(id) @request.get(['milestone', id.to_s]) end |
#get_milestone_tasks(id) ⇒ Object
22 23 24 |
# File 'lib/teamlab/modules/projects/projects_milestones.rb', line 22 def get_milestone_tasks(id) @request.get(['milestone', id.to_s, 'task']) end |
#get_milestones_by_filter(options = {}) ⇒ Object
18 19 20 |
# File 'lib/teamlab/modules/projects/projects_milestones.rb', line 18 def get_milestones_by_filter( = {}) @request.get(%w[milestone filter], ) end |
#get_milestones_by_full_date(year, month, day) ⇒ Object
30 31 32 |
# File 'lib/teamlab/modules/projects/projects_milestones.rb', line 30 def get_milestones_by_full_date(year, month, day) @request.get(['milestone', year.to_s, month.to_s, day.to_s]) end |
#get_milestones_by_month(year, month) ⇒ Object
26 27 28 |
# File 'lib/teamlab/modules/projects/projects_milestones.rb', line 26 def get_milestones_by_month(year, month) @request.get(['milestone', year.to_s, month.to_s]) end |
#get_overdue_milestones ⇒ Object
10 11 12 |
# File 'lib/teamlab/modules/projects/projects_milestones.rb', line 10 def get_overdue_milestones @request.get(%w[milestone late]) end |
#get_upcoming_milestones ⇒ Object
6 7 8 |
# File 'lib/teamlab/modules/projects/projects_milestones.rb', line 6 def get_upcoming_milestones @request.get(%w[milestone]) end |
#milestones_by_project_id(project_id) ⇒ Array
Returns a list of all the milestones within a project with the ID specified in the request
37 38 39 |
# File 'lib/teamlab/modules/projects/projects_milestones.rb', line 37 def milestones_by_project_id(project_id) @request.get([project_id.to_s, 'milestone']) end |
#milestones_by_project_id_and_status(project_id, status) ⇒ Array
Returns a list of all the milestones within a project with the ID and status specified in the request
45 46 47 |
# File 'lib/teamlab/modules/projects/projects_milestones.rb', line 45 def milestones_by_project_id_and_status(project_id, status) @request.get([project_id.to_s, 'milestone', status.to_s]) end |
#update_milestone(id, title, deadline, options = {}) ⇒ Object
64 65 66 |
# File 'lib/teamlab/modules/projects/projects_milestones.rb', line 64 def update_milestone(id, title, deadline, = {}) @request.put(['milestone', id.to_s], { title: title, deadline: deadline }.merge()) end |
#update_milestone_status(id, status) ⇒ Object
68 69 70 |
# File 'lib/teamlab/modules/projects/projects_milestones.rb', line 68 def update_milestone_status(id, status) @request.put(['milestone', id.to_s, 'status'], status: status) end |