Finding highest value in a Hash

You can use the max method on hash objects, but it's usage is a little
odd.

Let's say your hash is h. This returns the key for the highest value:

  h.max { |a,b| a.last <=> b.last }.first

Looks crazy, I know, but it should work. If you want the gory details
of what it's doing, just let me know. :slight_smile:

Jeff
softiesonrails.com