Class: Array
- Inherits:
-
Object
- Object
- Array
- Defined in:
- lib/tabulate.rb
Instance Method Summary collapse
Instance Method Details
#to_rows ⇒ Object
136 137 138 139 140 141 142 |
# File 'lib/tabulate.rb', line 136 def to_rows a = collect{|i| i.is_a?(Array) ? i : [ i ]} nr = a.collect{|i| i.size}.max rows = [] 0.upto( nr-1 ) {|j| rows << a.collect{|i| i[j] ? i[j] : ''} } rows end |