Class: Tablecon::Table

Inherits:
Object
  • Object
show all
Defined in:
lib/tablecon.rb

Instance Method Summary collapse

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_sObject

prints @list as a table



18
19
20
# File 'lib/tablecon.rb', line 18

def to_s
	@printer.str
end