Class: Ilpomodoro::PivotalTracker
- Inherits:
-
Object
- Object
- Ilpomodoro::PivotalTracker
- Defined in:
- lib/ilpomodoro/pivotal_tracker.rb
Instance Method Summary collapse
-
#initialize ⇒ PivotalTracker
constructor
A new instance of PivotalTracker.
- #login ⇒ Object
- #password ⇒ Object
- #project ⇒ Object
- #projects ⇒ Object
- #stories ⇒ Object
- #story ⇒ Object
- #username ⇒ Object
Constructor Details
#initialize ⇒ PivotalTracker
Returns a new instance of PivotalTracker.
16 17 18 |
# File 'lib/ilpomodoro/pivotal_tracker.rb', line 16 def initialize @h = HighLine.new end |
Instance Method Details
#login ⇒ Object
20 21 22 |
# File 'lib/ilpomodoro/pivotal_tracker.rb', line 20 def login PivotalTracker::Client.token(username, password) end |
#password ⇒ Object
55 56 57 |
# File 'lib/ilpomodoro/pivotal_tracker.rb', line 55 def password @password ||= @h.ask("enter your pivotaltracker password:"){ |q| q.echo = 'x' } end |
#project ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'lib/ilpomodoro/pivotal_tracker.rb', line 24 def project @project ||= @h.choose do |m| m.header = 'in which project you will be working on?' projects.each do |p| m.choice p end end end |
#projects ⇒ Object
47 48 49 |
# File 'lib/ilpomodoro/pivotal_tracker.rb', line 47 def projects PivotalTracker::Project.all end |
#stories ⇒ Object
43 44 45 |
# File 'lib/ilpomodoro/pivotal_tracker.rb', line 43 def stories project.stories.all(current_state: ['unscheduled','started']) end |
#story ⇒ Object
33 34 35 36 37 38 39 40 41 |
# File 'lib/ilpomodoro/pivotal_tracker.rb', line 33 def story @h.choose do |m| m.header= 'which of the following task will you be working on?' stories.each do |t| m.choice t end m.choice 'i would like to do other task...' end end |
#username ⇒ Object
51 52 53 |
# File 'lib/ilpomodoro/pivotal_tracker.rb', line 51 def username @h.ask("enter your pivotaltracker username:") end |