class Ruby::Pomodoro::Cmd::Base
Attributes
prompt[R]
worker[R]
Public Class Methods
new(printer: Ruby::Pomodoro::Printer.new, prompt: TTY::Prompt.new, worker: Ruby::Pomodoro::Worker.instance)
click to toggle source
@param [Ruby::Pomodoro::Printer] printer @param prompt [Object]
# File lib/ruby/pomodoro/cmd/base.rb, line 10 def initialize(printer: Ruby::Pomodoro::Printer.new, prompt: TTY::Prompt.new, worker: Ruby::Pomodoro::Worker.instance) @printer = printer @prompt = prompt @worker = worker end
Public Instance Methods
call()
click to toggle source
@abstract @return [Symbol, NilClass]
# File lib/ruby/pomodoro/cmd/base.rb, line 18 def call; end
Private Instance Methods
print(clear: true, **options)
click to toggle source
# File lib/ruby/pomodoro/cmd/base.rb, line 24 def print(clear: true, **options) @printer.clear_terminal if clear type, value = options.first case type when :template @printer.print_template(value, binding) when :text @printer.print(value, color: options[:color]) else nil end end