Method: TTY::Table::Border#initialize

Defined in:
lib/tty/table/border.rb

#initialize(column_widths, options = nil) ⇒ Object

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.

Instantiate a new object

Parameters:

  • column_widths (Array)

    the table column widths

  • options (BorderOptions) (defaults to: nil)


45
46
47
48
49
50
51
52
53
# File 'lib/tty/table/border.rb', line 45

def initialize(column_widths, options = nil)
  if self.class == Border
    fail NotImplementedError, "#{self} is an abstract class"
  else
    @widths = column_widths
    @border = TTY::Table::BorderOptions.from options
    @color  = Pastel.new
  end
end