class Tracker::Project
Attributes
project_id[R]
tracker_token[R]
Public Class Methods
new(tracker_token, project_id)
click to toggle source
# File lib/tracker-git/project.rb, line 8 def initialize(tracker_token, project_id) @tracker_token = tracker_token @project_id = project_id PivotalTracker::Client.token = tracker_token PivotalTracker::Client.use_ssl = true end
Public Instance Methods
accept(story)
click to toggle source
# File lib/tracker-git/project.rb, line 28 def accept(story) story.update(current_state: "accepted") end
add_label(story, label)
click to toggle source
# File lib/tracker-git/project.rb, line 32 def add_label(story, label) labels = (story.labels || "").split(",") labels << label story.update(labels: labels.join(",")) end
deliver(story)
click to toggle source
# File lib/tracker-git/project.rb, line 24 def deliver(story) story.update(current_state: "delivered") end
delivered()
click to toggle source
# File lib/tracker-git/project.rb, line 20 def delivered _project.stories.all(state: "delivered", story_type: ['bug', 'feature']) end
finished()
click to toggle source
# File lib/tracker-git/project.rb, line 16 def finished _project.stories.all(state: "finished", story_type: ['bug', 'feature']) end
Private Instance Methods
_project()
click to toggle source
# File lib/tracker-git/project.rb, line 39 def _project @project ||= PivotalTracker::Project.find(project_id) end