Class: TrackerApi::Resources::Project
- Includes:
- Shared::Base
- Defined in:
- lib/tracker_api/resources/project.rb
Instance Method Summary collapse
-
#activity(params = {}) ⇒ Array[Activity]
Provides a list of all the activity performed on a project.
-
#add_membership(params) ⇒ ProjectMembership
Add a new membership for the project.
-
#create_epic(params) ⇒ epic
Create a new epic in the project.
-
#create_story(params) ⇒ Story
Create a new story in the project.
-
#epic(epic_id, params = {}) ⇒ Epic
Find a epic by id for the project.
-
#epics(params = {}) ⇒ Array[Epic]
Provides a list of all the epics in the project.
-
#iterations(params = {}) ⇒ Array[Iteration]
Provides a list of all the iterations in the project.
-
#label_ids ⇒ Integer
Comma separated list of label_ids.
-
#label_list ⇒ String
Comma separated list of labels.
-
#labels(params = {}) ⇒ Array[Label]
Provides a list of all the labels on the project.
-
#memberships(params = {}) ⇒ Array[ProjectMembership]
Provides a list of all the memberships in the project.
-
#stories(params = {}) ⇒ Array[Story]
Provides a list of all the stories in the project.
-
#story(story_id, params = {}) ⇒ Story
Find a story by id for the project.
Methods included from Shared::Base
Instance Method Details
#activity(params = {}) ⇒ Array[Activity]
Provides a list of all the activity performed on a project.
133 134 135 |
# File 'lib/tracker_api/resources/project.rb', line 133 def activity(params={}) Endpoints::Activity.new(client).get_project(id, params) end |
#add_membership(params) ⇒ ProjectMembership
Add a new membership for the project.
173 174 175 |
# File 'lib/tracker_api/resources/project.rb', line 173 def add_membership(params) Endpoints::Memberships.new(client).add(id, params) end |
#create_epic(params) ⇒ epic
Create a new epic in the project.
165 166 167 |
# File 'lib/tracker_api/resources/project.rb', line 165 def create_epic(params) Endpoints::Epic.new(client).create(id, params) end |
#create_story(params) ⇒ Story
Create a new story in the project.
149 150 151 |
# File 'lib/tracker_api/resources/project.rb', line 149 def create_story(params) Endpoints::Story.new(client).create(id, params) end |
#epic(epic_id, params = {}) ⇒ Epic
Find a epic by id for the project.
157 158 159 |
# File 'lib/tracker_api/resources/project.rb', line 157 def epic(epic_id, params={}) Endpoints::Epic.new(client).get(id, epic_id, params) end |
#epics(params = {}) ⇒ Array[Epic]
Provides a list of all the epics in the project.
68 69 70 71 72 73 74 |
# File 'lib/tracker_api/resources/project.rb', line 68 def epics(params={}) if @epics && @epics.present? @epics else @epics = Endpoints::Epics.new(client).get(id, params) end end |
#iterations(params = {}) ⇒ Array[Iteration]
Provides a list of all the iterations in the project.
87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/tracker_api/resources/project.rb', line 87 def iterations(params={}) if params.include?(:number) number = params[:number].to_i raise ArgumentError, ':number must be > 0' unless number > 0 params = params.merge(auto_paginate: false, limit: 1) params.delete(:number) offset = number - 1 params[:offset] = offset if offset > 0 end Endpoints::Iterations.new(client).get(id, params) end |
#label_ids ⇒ Integer
Returns comma separated list of label_ids.
48 49 50 |
# File 'lib/tracker_api/resources/project.rb', line 48 def label_ids @label_ids ||= labels.collect(&:id).join(',') end |
#label_list ⇒ String
Returns comma separated list of labels.
43 44 45 |
# File 'lib/tracker_api/resources/project.rb', line 43 def label_list @label_list ||= labels.collect(&:name).join(',') end |
#labels(params = {}) ⇒ Array[Label]
Provides a list of all the labels on the project.
56 57 58 59 60 61 62 |
# File 'lib/tracker_api/resources/project.rb', line 56 def labels(params = {}) if @labels && @labels.present? @labels else @labels = Endpoints::Labels.new(client).get(id, params) end end |
#memberships(params = {}) ⇒ Array[ProjectMembership]
Provides a list of all the memberships in the project.
125 126 127 |
# File 'lib/tracker_api/resources/project.rb', line 125 def memberships(params={}) Endpoints::Memberships.new(client).get(id, params) end |