Method: TTY::Table::Field#length

Defined in:
lib/tty/table/field.rb

#lengthInteger

If the string contains unescaped new lines then the longest token deterimines the actual field length.

Returns:

  • (Integer)


109
110
111
112
113
# File 'lib/tty/table/field.rb', line 109

def length
  (lines.map do |line|
    Strings::Align.display_width(line)
  end << 0).max
end