Skip to content

Instantly share code, notes, and snippets.

@michaelminter
Created November 13, 2013 21:56
Show Gist options
  • Save michaelminter/7457166 to your computer and use it in GitHub Desktop.
Save michaelminter/7457166 to your computer and use it in GitHub Desktop.
Turn CSV delimited text string into hash
# tested on Ruby 1.9.3
CSV.parse(response.body, { :headers => true, header_converters: :symbol, converters: :all }).collect { |row| Hash[row.collect { |c,r| [c,r] }] }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment