Module: ConsoleTable

Defined in:
lib/console_table.rb

Overview

ConsoleTable allows you to define a table with columns set to specific sizes, and then give that table rows of data which it will format into a view that fits inside a terminal/console.

Author

Rod Hilton

License

MIT

Defined Under Namespace

Classes: ConsoleTableClass

Class Method Summary collapse

Class Method Details

.define(layout, options = {}, &block) ⇒ Object

Define a console table. Requires a table layout which specifies column information like sizes, titles, and key names.



11
12
13
14
15
16
# File 'lib/console_table.rb', line 11

def self.define(layout, options={}, &block)
  table = ConsoleTableClass.new(layout, options)
  table.send(:print_header)
  block.call(table)
  table.send(:print_footer)
end