Class: Flux::PT::Story::Finders

Inherits:
Object
  • Object
show all
Defined in:
lib/flux/pivotal_tracker.rb

Instance Method Summary collapse

Constructor Details

#initialize(project) ⇒ Finders

Returns a new instance of Finders.



40
41
42
# File 'lib/flux/pivotal_tracker.rb', line 40

def initialize(project)
  @project = project
end

Instance Method Details

#find(id) ⇒ Object



44
45
46
47
48
49
# File 'lib/flux/pivotal_tracker.rb', line 44

def find(id)
  story = ::PivotalTracker::Story.find(id, @project.id) or
    raise TrackerError, "Couldn't find story #{id}."

  Story.new(story)
end

#owned_by(member) ⇒ Object



58
59
60
61
# File 'lib/flux/pivotal_tracker.rb', line 58

def owned_by(member)
  ::PivotalTracker::Story.all(@project, :mywork => member.name).
    map { |s| Story.new(s) }
end

#scheduledObject



51
52
53
54
55
56
# File 'lib/flux/pivotal_tracker.rb', line 51

def scheduled
  ::PivotalTracker::Iteration.
    current_backlog(@project).
    map(&:stories).
    flatten.map { |s| Story.new(s) }
end

#unassignedObject



63
64
65
# File 'lib/flux/pivotal_tracker.rb', line 63

def unassigned
  scheduled.reject(&:owned_by)
end