Class: Tableview::Output::ASCII
- Inherits:
-
Object
- Object
- Tableview::Output::ASCII
- Defined in:
- lib/tableview/output/ascii.rb
Instance Method Summary collapse
Instance Method Details
#process(tv) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/tableview/output/ascii.rb', line 4 def process(tv) @table = "" tv.subtables.each do |sub| @table << "# #{sub.title}" unless sub.title.blank? @table << table { |t| sub.parts.each do |part| part.rows.each do |row| t.add_row row.cells.map {|cell| {:value => cell.contents}.merge(cell.) } end t.add_separator unless part == sub.parts.last end }.to_s end end |
#to_s ⇒ Object
19 20 21 |
# File 'lib/tableview/output/ascii.rb', line 19 def to_s @table end |