Method: TTY::Table#initialize
- Defined in:
- lib/tty/table.rb
#initialize(options = {}, &block) ⇒ TTY::Table
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initialize a Table
114 115 116 117 118 119 120 121 122 123 124 125 |
# File 'lib/tty/table.rb', line 114 def initialize( = {}, &block) @header = (value = [:header]) ? Header.new(value) : nil @rows = coerce(.fetch(:rows) { Row.new([]) }) @rotated = false self.orientation = .fetch(:orientation) { :horizontal } assert_row_sizes @rows orientation.transform(self) yield_or_eval(&block) if block_given? end |