abstract class TableOutput

Direct Known Subclasses

Defined in:

table_output.cr

Constant Summary

COLUMN_WIDTH = 16
DIFF_STYLER = ->(cell : Tablo::CellType) do color = if cell.to_s.starts_with?("-") :red else :green end (cell.colorize(color)).to_s end
HIGHLIGHT_STYLER = ->(cell : Tablo::CellType) do match = cell.to_s.match(/(.*)\*(.+)\*(.*)/) if match "#{match[1]}#{((match[2].colorize(:black)).back(:yellow)).to_s}#{match[3]} " else cell.to_s end end

Adds a yellow background to the text between *text*. At the end we add to whitespaces to keep the length of the cell

Instance Method Summary

Instance Method Detail

abstract def empty? #

[View source]
abstract def header_content #

[View source]
def render #

[View source]
abstract def render_footer #

[View source]
abstract def render_table #

[View source]