Class: Tablecon::Table
- Inherits:
-
Object
- Object
- Tablecon::Table
- Defined in:
- lib/tablecon.rb
Instance Method Summary collapse
-
#initialize(list) ⇒ Table
constructor
- Params:
list -
a list of instances of the same class where every field will be treated as a separate column.
- Params:
-
#to_s ⇒ Object
prints @list as a table.
Constructor Details
#initialize(list) ⇒ Table
Params:
list-
a list of instances of the same class
where every field will be treated as a separate column
11 12 13 14 |
# File 'lib/tablecon.rb', line 11 def initialize list lp = ListParser.new list @printer = TablePrinter.new lp.rows end |
Instance Method Details
#to_s ⇒ Object
prints @list as a table
18 19 20 |
# File 'lib/tablecon.rb', line 18 def to_s @printer.str end |