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.
160 161 162 |
# File 'lib/tracker_api/resources/project.rb', line 160 def activity(params={}) Endpoints::Activity.new(client).get_project(id, params) end |
#add_membership(params) ⇒ ProjectMembership
Add a new membership for the project.
200 201 202 |
# File 'lib/tracker_api/resources/project.rb', line 200 def add_membership(params) Endpoints::Memberships.new(client).add(id, params) end |
#add_webhook(params) ⇒ Webhook
Create a new webhook for the project.
216 217 218 |
# File 'lib/tracker_api/resources/project.rb', line 216 def add_webhook(params) Endpoints::Webhook.new(client).create(id, params) end |
#create_epic(params) ⇒ epic
Create a new epic in the project.
192 193 194 |
# File 'lib/tracker_api/resources/project.rb', line 192 def create_epic(params) Endpoints::Epic.new(client).create(id, params) end |
#create_story(params) ⇒ Story
Create a new story in the project.
176 177 178 |
# File 'lib/tracker_api/resources/project.rb', line 176 def create_story(params) Endpoints::Story.new(client).create(id, params) end |
#delete_webhook(webhook_id) ⇒ Object
Delete webhook from the project.
223 224 225 |
# File 'lib/tracker_api/resources/project.rb', line 223 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.
184 185 186 |
# File 'lib/tracker_api/resources/project.rb', line 184 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.
70 71 72 73 74 75 76 |
# File 'lib/tracker_api/resources/project.rb', line 70 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.
101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/tracker_api/resources/project.rb', line 101 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.
50 51 52 |
# File 'lib/tracker_api/resources/project.rb', line 50 def label_ids @label_ids ||= labels.collect(&:id).join(',') end |
#label_list ⇒ String
Returns comma separated list of labels.
45 46 47 |
# File 'lib/tracker_api/resources/project.rb', line 45 def label_list @label_list ||= labels.collect(&:name).join(',') end |
#labels(params = {}) ⇒ Array[Label]
Provides a list of all the labels on the project.
58 59 60 61 62 63 64 |
# File 'lib/tracker_api/resources/project.rb', line 58 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.
152 153 154 |
# File 'lib/tracker_api/resources/project.rb', line 152 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.
144 145 146 |
# File 'lib/tracker_api/resources/project.rb', line 144 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/
233 234 235 |
# File 'lib/tracker_api/resources/project.rb', line 233 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.
131 132 133 |
# File 'lib/tracker_api/resources/project.rb', line 131 def stories(params={}) Endpoints::Stories.new(client).get(id, params) end |
#story(story_id, params = {}) ⇒ Story
Find a story by id for the project.
168 169 170 |
# File 'lib/tracker_api/resources/project.rb', line 168 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.
208 209 210 |
# File 'lib/tracker_api/resources/project.rb', line 208 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.
82 83 84 85 86 87 88 |
# File 'lib/tracker_api/resources/project.rb', line 82 def webhooks(params={}) if @webhooks && @webhooks.present? @webhooks else @webhooks = Endpoints::Webhooks.new(client).get(id, params) end end |