Monthly Archives: September 2008

ruby csv to structured hash

I had a csv like this: object color flavor shape apple red sweet round banana yellow sweet long lemon yellow sour round and I wanted a ruby hash structured like this: So I wrote this, which does the job:

Posted in rails, ruby | Leave a comment