generate csv from ruby object

Have you looked a Comma, http://redartisan.com/2009/3/10/comma-intro ?

Eifion
http://asciicasts.com
Twitter: @eifion