Class: Pompom::Application
- Inherits:
-
Object
- Object
- Pompom::Application
- Defined in:
- lib/pompom.rb
Instance Attribute Summary collapse
-
#worklog ⇒ Object
readonly
Returns the value of attribute worklog.
Instance Method Summary collapse
- #cleanup ⇒ Object
-
#initialize(options) ⇒ Application
constructor
A new instance of Application.
- #run ⇒ Object
Constructor Details
#initialize(options) ⇒ Application
Returns a new instance of Application.
16 17 18 19 20 21 22 23 |
# File 'lib/pompom.rb', line 16 def initialize() @options = if [:no_log] @worklog = NullWorkLog.new else @worklog = Worklog.new([:log]) end end |
Instance Attribute Details
#worklog ⇒ Object (readonly)
Returns the value of attribute worklog.
14 15 16 |
# File 'lib/pompom.rb', line 14 def worklog @worklog end |
Instance Method Details
#cleanup ⇒ Object
33 34 35 |
# File 'lib/pompom.rb', line 33 def cleanup @worklog.finish_early end |
#run ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/pompom.rb', line 25 def run new_pomodoro do |pomodoro| @worklog.start pomodoro pomodoro.tick until pomodoro.finished? end play_sound end |