class TTY::Table::Operation::Truncation
@api private
A class responsible for shortening text.
def call(field, row, col)
- Api: - public
Returns:
-
(TTY::Table::Field)-
Parameters:
-
col(Integer) -- -
row(Integer) -- -
field(TTY::Table::Field) --
def call(field, row, col) column_width = widths[col] || field.width Strings.truncate(field.content, column_width) end
def initialize(widths)
- Api: - public
def initialize(widths) @widths = widths end