Class: Ruby::Pomodoro::Cmd::Quit

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

Overview

Save tasks and stop program

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

#call(editor) ⇒ Symbol

Parameters:

Returns:

  • (Symbol)


8
9
10
11
12
13
14
15
# File 'lib/ruby/pomodoro/cmd/quit.rb', line 8

def call(editor)
  worker.delete_observers
  worker.stop
  editor.save
  Main.new.call
  print text: "Bye!\n", color: :green, clear: false
  :quit
end