October 23 2011
Ruby Tip: Sort a hash recursively
A while ago, I found a great Stackoverflow answer for sorting a hash in Ruby:
But recently, I wanted to take it a bit further and recursively sort all the hashes in an object, even if they are inside of an array. Here is a snippet to do that: