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.
-
#add_webhook(params) ⇒ Webhook
Create a new webhook 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.
-
#delete_webhook(webhook_id) ⇒ Object
Delete webhook from 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.
-
#releases(params = {}) ⇒ Array[Release]
Provides a list of all the releases in the project.
-
#search(query, params = {}) ⇒ SearchResultsContainer
Search for a term in the given 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.
-
#webhook(webhook_id, params = {}) ⇒ Webhook
Find a webhook for the project.
-
#webhooks(params = {}) ⇒ Array[Webhook]
Provides a list of all the webhooks in 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.
159 160 161 |
# File 'lib/tracker_api/resources/project.rb', line 159 def activity(params={}) Endpoints::Activity.new(client).get_project(id, params) end |
#add_membership(params) ⇒ ProjectMembership
Add a new membership for the project.
199 200 201 |
# File 'lib/tracker_api/resources/project.rb', line 199 def add_membership(params) Endpoints::Memberships.new(client).add(id, params) end |
#add_webhook(params) ⇒ Webhook
Create a new webhook for the project.
215 216 217 |
# File 'lib/tracker_api/resources/project.rb', line 215 def add_webhook(params) Endpoints::Webhook.new(client).create(id, params) end |
#create_epic(params) ⇒ epic
Create a new epic in the project.
191 192 193 |
# File 'lib/tracker_api/resources/project.rb', line 191 def create_epic(params) Endpoints::Epic.new(client).create(id, params) end |
#create_story(params) ⇒ Story
Create a new story in the project.
175 176 177 |
# File 'lib/tracker_api/resources/project.rb', line 175 def create_story(params) Endpoints::Story.new(client).create(id, params) end |
#delete_webhook(webhook_id) ⇒ Object
Delete webhook from the project.
222 223 224 |
# File 'lib/tracker_api/resources/project.rb', line 222 def delete_webhook(webhook_id) Endpoints::Webhook.new(client).delete_from_project(id, webhook_id) end |
#epic(epic_id, params = {}) ⇒ Epic
Find a epic by id for the project.
183 184 185 |
# File 'lib/tracker_api/resources/project.rb', line 183 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.
69 70 71 72 73 74 75 |
# File 'lib/tracker_api/resources/project.rb', line 69 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.
100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/tracker_api/resources/project.rb', line 100 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.
49 50 51 |
# File 'lib/tracker_api/resources/project.rb', line 49 def label_ids @label_ids ||= labels.collect(&:id).join(',') end |
#label_list ⇒ String
Returns comma separated list of labels.
44 45 46 |
# File 'lib/tracker_api/resources/project.rb', line 44 def label_list @label_list ||= labels.collect(&:name).join(',') end |
#labels(params = {}) ⇒ Array[Label]
Provides a list of all the labels on the project.
57 58 59 60 61 62 63 |
# File 'lib/tracker_api/resources/project.rb', line 57 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.
151 152 153 |
# File 'lib/tracker_api/resources/project.rb', line 151 def memberships(params={}) Endpoints::Memberships.new(client).get(id, params) end |
#releases(params = {}) ⇒ Array[Release]
Provides a list of all the releases in the project.
143 144 145 |
# File 'lib/tracker_api/resources/project.rb', line 143 def releases(params={}) Endpoints::Releases.new(client).get(id, params) end |
#search(query, params = {}) ⇒ SearchResultsContainer
Search for a term in the given project. This can be an arbitrary term or a specific search query. See www.pivotaltracker.com/help/articles/advanced_search/
232 233 234 |
# File 'lib/tracker_api/resources/project.rb', line 232 def search(query, params={}) Endpoints::Search.new(client).get(id, query, params) end |
#stories(params = {}) ⇒ Array[Story]
Provides a list of all the stories in the project.
130 131 132 |
# File 'lib/tracker_api/resources/project.rb', line 130 def stories(params={}) Endpoints::Stories.new(client).get(id, params) end |
#story(story_id, params = {}) ⇒ Story
Find a story by id for the project.
167 168 169 |
# File 'lib/tracker_api/resources/project.rb', line 167 def story(story_id, params={}) Endpoints::Story.new(client).get(id, story_id, params) end |
#webhook(webhook_id, params = {}) ⇒ Webhook
Find a webhook for the project.
207 208 209 |
# File 'lib/tracker_api/resources/project.rb', line 207 def webhook(webhook_id, params={}) Endpoints::Webhook.new(client).get(id, webhook_id, params) end |
#webhooks(params = {}) ⇒ Array[Webhook]
Provides a list of all the webhooks in the project.
81 82 83 84 85 86 87 |
# File 'lib/tracker_api/resources/project.rb', line 81 def webhooks(params={}) if @webhooks && @webhooks.present? @webhooks else @webhooks = Endpoints::Webhooks.new(client).get(id, params) end end |