Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/tabulate.rb

Instance Method Summary collapse

Instance Method Details

#to_rowsObject



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