Class: TTY::Table::Border
- Inherits:
-
Object
- Object
- TTY::Table::Border
- Includes:
- Unicode
- Defined in:
- lib/tty/table/border.rb,
lib/tty/table/border/null.rb,
lib/tty/table/border/ascii.rb,
lib/tty/table/border/unicode.rb
Overview
Abstract base class that is responsible for building the table border.
Defined Under Namespace
Constant Summary collapse
- NEWLINE =
"\n"
Instance Method Summary collapse
-
#bottom_line ⇒ String
private
A line spannig all columns marking bottom of a table.
-
#initialize ⇒ Object
constructor
private
Instantiate a new object.
-
#row_line ⇒ String
private
A line spanning all columns delemeting cells in a row.
-
#separator ⇒ String
private
A line spanning all columns delemeting rows in a table.
-
#top_line ⇒ String
private
A line spanning all columns marking top of a table.
Methods included from Unicode
#as_unicode, #clean_utf8, #utf8?
Constructor Details
#initialize ⇒ 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
29 30 31 32 33 34 35 |
# File 'lib/tty/table/border.rb', line 29 def initialize(*) if self.class == Border raise NotImplementedError, "#{self} is an abstract class" else super end end |
Instance Method Details
#bottom_line ⇒ String
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.
A line spannig all columns marking bottom of a table.
69 70 71 |
# File 'lib/tty/table/border.rb', line 69 def bottom_line render :bottom end |
#row_line ⇒ String
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.
A line spanning all columns delemeting cells in a row.
60 61 62 |
# File 'lib/tty/table/border.rb', line 60 def row_line self['left'] + row.join(self['right']) + self['right'] end |
#separator ⇒ String
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.
A line spanning all columns delemeting rows in a table.
51 52 53 |
# File 'lib/tty/table/border.rb', line 51 def separator render :mid end |
#top_line ⇒ String
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.
A line spanning all columns marking top of a table.
42 43 44 |
# File 'lib/tty/table/border.rb', line 42 def top_line render :top end |