Class: Pomodoro::Commands::Reset

Inherits:
Command
  • Object
show all
Defined in:
lib/pomodoro/commands/reset.rb

Instance Method Summary collapse

Constructor Details

This class inherits a constructor from Pomodoro::Commands::Command

Instance Method Details

#runObject


8
9
10
11
12
13
14
15
16
17
18
# File 'lib/pomodoro/commands/reset.rb', line 8

def run
  ensure_today

  if with_active_task(self.config) do |active_task|
        active_task.reset!
        puts t(:success, task: Pomodoro::Tools.unsentence(active_task.body))
     end
  else
    abort t(:no_task_in_progress)
  end
end