class Minder::PomodoroFrame

Public Instance Methods

handle_char_keypress(key) click to toggle source
# File lib/minder/cli/pomodoro_frame.rb, line 31
def handle_char_keypress(key)
  event = case key
  when ' ' then :continue
  end

  changed
  notify_observers(event)
end
handle_non_char_keypress(key) click to toggle source
# File lib/minder/cli/pomodoro_frame.rb, line 40
def handle_non_char_keypress(key)
  event = case key
  when 3 then :exit
  end

  changed
  notify_observers(event)
end
period() click to toggle source
# File lib/minder/cli/pomodoro_frame.rb, line 27
def period
  pomodoro_runner.current_period
end
pomodoros() click to toggle source
# File lib/minder/cli/pomodoro_frame.rb, line 53
def pomodoros
  pomodoro_runner.pomodoros_today.map do |pomodoro|
    "#{pomodoro_runner.emoji} "
  end.join
end
set_cursor_position() click to toggle source
# File lib/minder/cli/pomodoro_frame.rb, line 49
def set_cursor_position
  window.setpos(1, lines[0].strip.length + 2)
end
template() click to toggle source
# File lib/minder/cli/pomodoro_frame.rb, line 5
    def template
      text = <<-TEXT
<%= period.title %>  #{pomodoros}
TEXT

      if period.message
        text += <<-TEXT

<%= period.message %>
TEXT
      end

      if task_manager.started_task
        text += <<-TEXT

Working on: #{task_manager.started_task}
TEXT
      end

      text
    end