Skip to content

Instantly share code, notes, and snippets.

@Aerlinger
Created August 27, 2013 05:55
Show Gist options
  • Save Aerlinger/6350064 to your computer and use it in GitHub Desktop.
Save Aerlinger/6350064 to your computer and use it in GitHub Desktop.
Pretty print a hash in ruby
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