Class: PivotalToTrello::PivotalWrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/pivotal_to_trello/pivotal_wrapper.rb

Overview

Interface to the Pivotal Tracker API.

Instance Method Summary collapse

Constructor Details

#initialize(token) ⇒ PivotalWrapper

Constructor



8
9
10
# File 'lib/pivotal_to_trello/pivotal_wrapper.rb', line 8

def initialize(token)
  ::PivotalTracker::Client.token = token
end

Instance Method Details

#project_choicesObject

Returns a hash of available projects keyed on project ID.



13
14
15
16
17
18
# File 'lib/pivotal_to_trello/pivotal_wrapper.rb', line 13

def project_choices
  ::PivotalTracker::Project.all.inject({}) do |hash, project|
    hash[project.id] = project.name
    hash
  end
end

#stories(project_id) ⇒ Object

Returns all stories for the given project.



21
22
23
# File 'lib/pivotal_to_trello/pivotal_wrapper.rb', line 21

def stories(project_id)
  project(project_id).stories.all
end