Methods

Class Index [+]

Quicksearch

Sequel::PrettyTable

Public Class Methods

string(records, columns = nil) click to toggle source

Return the string that # will print via puts.

    # File lib/sequel/extensions/_pretty_table.rb, line 20
20:     def self.string(records, columns = nil) # records is an array of hashes
21:       columns ||= records.first.keys.sort_by{|x|x.to_s}
22:       sizes = column_sizes(records, columns)
23:       sep_line = separator_line(columns, sizes)
24: 
25:       array = [sep_line, header_line(columns, sizes), sep_line]
26:       records.each {|r| array << data_line(columns, sizes, r)}
27:       array << sep_line
28:       array.join("\n")
29:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.