Created
August 14, 2015 11:24
-
-
Save lukemorton/b208d35b122cec347806 to your computer and use it in GitHub Desktop.
This file contains 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
def hash_to_csv(hash) | |
csv = hash.map { |k, v| "#{k},#{v}" }.join("\n") | |
File.open('hash.csv', 'w') { |f| f.write(csv) } | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment