From: Marcelo Alvim Date: 2006-09-13T09:02:35+09:00 Subject: Re: Maximum value of hash > Actually the Enumerable mixin module implements max, so any enumerable > has it, and gives you the maximum element yielded by each > > (1..10).max #=> 10 > {'a' => 1, 'b' => 7}.max #=> ["b", 7] > "abc\ndef".max #=> "def" This is really sweet, but I think in this context it's worth noting that: {'a' => 1, 'b' => 10, 'z' => 5}.max #=> ["z", 5] As the thread is about hashes, it's nice to know that the #max method, when applied to hashes, apparently yields the maximum value for the keys, not for the values. Alvim.