module Thyme::Format

Overview

Handles returning formatted strings presented to the end user.

Extended Modules

Defined in:

thyme/format.cr

Instance Method Summary

Instance Method Detail

def repeat_suffix(repeat_index : UInt32, repeat_total : UInt32) #

Returns repeat string to tell user which pomodoro they're currently on and how many there are in total. If repeat is off, return a blank string.


[View source]
def status(total_seconds : Int64, suffix : String, on_break : Bool, config : Config) #

Returns formatted timer string for Tmux's status. Note that suffix is a parameter here so we can cache the repeat_suffix outside of the seconds loop, since it only gets re-calculated after a pomodoro/break ends -- while the rest of the status is updated per second.


[View source]
def tmux_color(total_seconds : Int64, on_break : Bool, config : Config) #

Determines which color to use for the current time: break, warning, or default.


[View source]
def with_color(text : String, color : String) #

Wraps a string with a Tmux template for colors.


[View source]