Method: Terminal::Table#initialize
- Defined in:
- lib/terminal-table/table.rb
#initialize(options = {}, &block) ⇒ Table
Generates a ASCII/Unicode table with the given options.
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/terminal-table/table.rb', line 12 def initialize = {}, &block @elaborated = false @headings = [] @rows = [] @column_widths = [] self.style = .fetch :style, {} self.headings = .fetch :headings, [] self.rows = .fetch :rows, [] self.title = .fetch :title, nil yield_or_eval(&block) if block style.on_change(:width) { require_column_widths_recalc } end |