Sha256: c615288eed2d62ca4d7aefc00ce4478b41471657c6335fce32f36d0f4f2cff46

Contents?: true

Size: 474 Bytes

Versions: 1

Compression:

Stored size: 474 Bytes

Contents

require 'hammer_cli/output/utils'

module TablePrint
  class Column
    def data_width
      if multibyte_count
        [
          HammerCLI::Output::Utils.real_length(name),
          Array(data).compact.collect(&:to_s).collect{|m| HammerCLI::Output::Utils.real_length(m) }.max
        ].compact.max || 0
      else
        [
          name.length,
          Array(data).compact.collect(&:to_s).collect(&:length).max
        ].compact.max || 0
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hammer_cli-0.9.0 lib/hammer_cli/table_print/column.rb