Method: #calculate_column_width
- Defined in:
- lib/cetusql/cli_sqlite.rb
#calculate_column_width(content, col, maxrows = 99) ⇒ Object
200 201 202 203 204 205 206 207 208 209 210 211 |
# File 'lib/cetusql/cli_sqlite.rb', line 200 def calculate_column_width content, col, maxrows=99 ret = 1 ctr = 0 content.each_with_index { |r, i| break if ctr > maxrows ctr += 1 c = r[col] x = c.to_s.length ret = x if x > ret } ret end |