From: Trans Date: 2006-09-13T00:10:04+09:00 Subject: Re: Maximum value of hash Bart Braem wrote: > A very simple question: what's the best way to get the maximum value of a > hash? Currently I have something like: > > max = 0 > hash.each_value do |value| > if (value > max ) > max = value > end > end > > But it does not feel ruby... Same question for sum, but I guess the answer > will be similar? > > Bart hash.values.max T.