public
Description: Fast, Nimble PDF Writer for Ruby
Homepage: http://prawn.majesticseacreature.com
Clone URL: git://github.com/sandal/prawn.git
Automatically call to_s on each table cell
sandal (author)
Wed Jul 23 09:52:59 -0700 2008
commit  d335b2a86ebefb68eb7effe6401491fd894e33f8
tree    add2a43ea320345fee57a817fd1214c7e4f76364
parent  a22c3b568dd29e29bea254e2d99f89d87809e48a
...
145
146
147
148
 
149
150
151
...
174
175
176
177
 
178
179
180
...
145
146
147
 
148
149
150
151
...
174
175
176
 
177
178
179
180
0
@@ -145,7 +145,7 @@ module Prawn
0
         @col_widths = [0] * @data[0].length    
0
         renderable_data.each do |row|
0
           row.each_with_index do |cell,i|
0
-            length = cell.lines.map { |e| 
0
+            length = cell.to_s.lines.map { |e| 
0
               @document.font_metrics.string_width(e,@font_size) }.max.to_f +
0
                 2*@horizontal_padding
0
             @col_widths[i] = length if length > @col_widths[i]
0
@@ -174,7 +174,7 @@ module Prawn
0
             row.each_with_index do |e,i|
0
               c << Prawn::Graphics::Cell.new(
0
                 :document => @document, 
0
-                :text     => e
0
+                :text     => e.to_s
0
                 :width    => @col_widths[i],
0
                 :horizontal_padding => @horizontal_padding,
0
                 :vertical_padding => @vertical_padding,

Comments