Class: TTY::Table::Empty

Inherits:
TTY::Table show all
Defined in:
lib/tty/table/empty.rb

Constant Summary collapse

ZERO_ROW =
[].freeze

Constants inherited from TTY::Table

VERSION

Instance Attribute Summary

Attributes inherited from TTY::Table

#header, #orientation, #original_columns, #original_rows, #rows

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from TTY::Table

#<<, #==, #[], [], #[]=, #coerce, #column, #columns_size, #data, #each_with_index, #empty?, #eql?, #hash, #initialize, #inspect, #render, #render_with, #renderer, #rotate, #rotate_horizontal, #rotate_vertical, #rotated?, #row, #rows_size, #separators, #to_header, #to_row, #to_s

Methods included from Validatable

#assert_row_size, #assert_row_sizes, #assert_table_type, #validate_options!

Constructor Details

This class inherits a constructor from TTY::Table

Class Method Details

.new(header, rows = ZERO_ROW) ⇒ Object



9
10
11
# File 'lib/tty/table/empty.rb', line 9

def self.new(header, rows = ZERO_ROW)
  super.new(header, rows)
end

Instance Method Details

#eachObject



13
14
15
16
# File 'lib/tty/table/empty.rb', line 13

def each
  return to_enum unless block_given?
  self
end

#sizeObject



18
19
20
# File 'lib/tty/table/empty.rb', line 18

def size
  0
end

#widthObject



22
23
24
# File 'lib/tty/table/empty.rb', line 22

def width
  0
end