Module: Sequel::PrettyTable

Module | Sequel::PrettyTable
In: | lib/sequel_core/pretty_table.rb

### Methods

print

### Public Class methods

print(records, columns = nil)

Prints nice-looking plain-text tables via puts

      +--+-------+
      |id|name   |
      |--+-------|
      |1 |fasdfas|
      |2 |test   |
      +--+-------+

[Source]

        # File lib/sequel_core/pretty_table.rb, line 11
    11:     def self.print(records, columns = nil) # records is an array of hashes
    12:       columns ||= records.first.keys.sort_by{|x|x.to_s}
    13:       sizes = column_sizes(records, columns)
    14:       sep_line = separator_line(columns, sizes)
    15:
    16:       puts sep_line
    17:       puts header_line(columns, sizes)
    18:       puts sep_line
    19:       records.each {|r| puts data_line(columns, sizes, r)}
    20:       puts sep_line
    21:     end

[Validate]