Created
November 13, 2013 21:56
-
-
Save michaelminter/7457166 to your computer and use it in GitHub Desktop.
Turn CSV delimited text string into hash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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