rgviz 0.43 → 0.44
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rgviz/csv_renderer.rb +4 -4
- metadata +1 -1
data/lib/rgviz/csv_renderer.rb
CHANGED
@@ -2,17 +2,17 @@ module Rgviz
|
|
2
2
|
module CsvRenderer
|
3
3
|
def self.render(table)
|
4
4
|
string = ''
|
5
|
-
table.cols.each_with_index do |
|
5
|
+
table.cols.each_with_index do |col, i|
|
6
6
|
string << ',' if i > 0
|
7
|
-
string << CsvRenderer.format(
|
7
|
+
string << CsvRenderer.format(col.label)
|
8
8
|
end
|
9
9
|
|
10
10
|
length = table.rows.length
|
11
11
|
string << "\n" if length > 0
|
12
12
|
|
13
13
|
table.rows.each_with_index do |row, i|
|
14
|
-
row.c.each_with_index do |col,
|
15
|
-
string << ',' if
|
14
|
+
row.c.each_with_index do |col, j|
|
15
|
+
string << ',' if j > 0
|
16
16
|
string << CsvRenderer.format((col.f || col.v).to_s)
|
17
17
|
end
|
18
18
|
string << "\n" if i != length - 1
|