Class: Ruby::Pomodoro::Cmd::ChooseTask

Inherits:
Base
  • Object
show all
Defined in:
lib/ruby/pomodoro/cmd/choose_task.rb

Overview

Select task and start worker

Instance Method Summary collapse

Methods inherited from Base

#initialize

Methods included from TimeHelpers

#to_format_string

Constructor Details

This class inherits a constructor from Ruby::Pomodoro::Cmd::Base

Instance Method Details

#callObject

Parameters:



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/ruby/pomodoro/cmd/choose_task.rb', line 7

def call
  worker.pause if worker.working?
  print
  task = Ruby::Pomodoro::Tasks::Resource.find(select_task(worker.current_task))
  Main.new.call
  if task
    worker.stop
    worker.start(task)
  else
    worker.resume if worker.paused?
  end
  :ok
end