Created
August 27, 2013 05:55
-
-
Save Aerlinger/6350064 to your computer and use it in GitHub Desktop.
Pretty print a hash in ruby
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 pretty_hash(hash_obj) | |
hash_obj.inject("\n") { |collection, item| collection << " #{item[0]}: #{item[1]},\n" } | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment