Class: PivotalToTrello::PivotalWrapper
- Inherits:
-
Object
- Object
- PivotalToTrello::PivotalWrapper
- Defined in:
- lib/pivotal_to_trello/pivotal_wrapper.rb
Overview
Interface to the Pivotal Tracker API.
Instance Method Summary collapse
-
#initialize(token) ⇒ PivotalWrapper
constructor
Constructor.
-
#project_choices ⇒ Object
Returns a hash of available projects keyed on project ID.
-
#stories(project_id) ⇒ Object
Returns all stories for the given project.
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_choices ⇒ Object
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 |