Class: TTY::Table::Border::ASCII

Inherits:
TTY::Table::Border show all
Defined in:
lib/tty/table/border/ascii.rb

Overview

A class that represents an ascii border.

Constant Summary collapse

BORDER_TYPE =
{
'top'          => '-',
'top_mid'      => '+',
'top_left'     => '+',
'top_right'    => '+',
'bottom'       => '-',
'bottom_mid'   => '+',
'bottom_left'  => '+',
'bottom_right' => '+',
'mid'          => '-',
'mid_mid'      => '+',
'mid_left'     => '+',
'mid_right'    => '+',
'left'         => '|',
'right'        => '|'
}

Constants inherited from TTY::Table::Border

NEWLINE

Instance Method Summary collapse

Methods inherited from TTY::Table::Border

#bottom_line, #row_line, #separator, #top_line

Methods included from Unicode

#as_unicode, #clean_utf8, #utf8?

Constructor Details

#initialize(row) ⇒ ASCII

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.

Returns a new instance of ASCII.



33
34
35
36
# File 'lib/tty/table/border/ascii.rb', line 33

def initialize(row)
  @row = row
  @widths = row.map { |cell| cell.chars.to_a.size }
end

Instance Method Details

#[](type) ⇒ 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.



28
29
30
# File 'lib/tty/table/border/ascii.rb', line 28

def [](type)
  BORDER_TYPE[type]
end