Class: Ruby::Pomodoro::Cmd::Pause
- Defined in:
- lib/ruby/pomodoro/cmd/pause.rb
Instance Method Summary collapse
Methods inherited from Base
Methods included from TimeHelpers
Constructor Details
This class inherits a constructor from Ruby::Pomodoro::Cmd::Base
Instance Method Details
#call ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/ruby/pomodoro/cmd/pause.rb', line 5 def call if worker.working? Main.new.call worker.pause choices = [ { key: 'y', name: "Resume this task", value: true }, { key: 'n', name: 'Stop this task', value: false }, ] print text: "#{worker.current_task.name} was paused\n", color: :yellow, clear: false if prompt.("Resume?", choices) Main.new.call worker.resume else Stop.new.call end else Main.new.call end end |