Class: RTables::Table::SimpleTable
- Inherits:
-
RTables::TableBuilder
- Object
- RTables::TableBuilder
- RTables::Table::SimpleTable
- Defined in:
- lib/rtables/tables/simpletable.rb
Instance Attribute Summary
Attributes inherited from RTables::TableBuilder
#columns, #rows, #table_content, #table_header
Instance Method Summary collapse
Methods inherited from RTables::TableBuilder
#add_column, #add_row, #column_exist?, #empty?, #initialize, #inspect, #raise_if_empty, #to_s
Constructor Details
This class inherits a constructor from RTables::TableBuilder
Instance Method Details
#render ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/rtables/tables/simpletable.rb', line 4 def render raise_if_empty lines = [] i = 0 @table_content.each do |content| line = [] @table_header.each do |header| line << "#{header}: #{content[i]}" i += 1 end lines << line.join(', ') i = 0 end lines end |