Class: PivotalTracker::Project

Inherits:
Object
  • Object
show all
Includes:
HappyMapper
Defined in:
lib/pivotal-tracker/project.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.allObject



6
7
8
# File 'lib/pivotal-tracker/project.rb', line 6

def all
  @found = parse(Client.connection['/projects'].get)
end

.find(id) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/pivotal-tracker/project.rb', line 10

def find(id)
  if @found
    @found.detect { |document| document.id == id }
  else
    parse(Client.connection["/projects/#{id}"].get)
  end
end

Instance Method Details

#activitiesObject



32
33
34
# File 'lib/pivotal-tracker/project.rb', line 32

def activities
  @activities ||= Proxy.new(self, Activity)
end

#iteration(group) ⇒ Object



48
49
50
51
52
53
54
55
56
# File 'lib/pivotal-tracker/project.rb', line 48

def iteration(group)
  case group.to_sym
  when :done then Iteration.done(self)
  when :current then Iteration.current(self)
  when :backlog then Iteration.backlog(self)
  else
    raise ArgumentError, "Invalid group. Use :done, :current or :backlog instead."
  end
end

#iterationsObject



36
37
38
# File 'lib/pivotal-tracker/project.rb', line 36

def iterations
  @iterations ||= Proxy.new(self, Iteration)
end

#membershipsObject



44
45
46
# File 'lib/pivotal-tracker/project.rb', line 44

def memberships
  @memberships ||= Proxy.new(self, Membership)
end

#storiesObject



40
41
42
# File 'lib/pivotal-tracker/project.rb', line 40

def stories
  @stories ||= Proxy.new(self, Story)
end