It's a little bit difficult to make grid output display columns in the order you want. An array of hashes with the same keys is turned in to a grid, but the column order is essentially random.
It would be nice if there were a way to return a two dimensional array, columns on the first row, data on all following rows. Similarly, it would be nice if a Hash with only the keys [:type, :columns, :data] returned itself from too_cute, to allow custom formatting in a snippet.
I made this class to help, but it could be even easier if the base types were handled differently.
It's a little bit difficult to make grid output display columns in the order you want. An array of hashes with the same keys is turned in to a grid, but the column order is essentially random.
It would be nice if there were a way to return a two dimensional array, columns on the first row, data on all following rows. Similarly, it would be nice if a Hash with only the keys [:type, :columns, :data] returned itself from too_cute, to allow custom formatting in a snippet.
I made this class to help, but it could be even easier if the base types were handled differently.
http://gist.github.com/117243