From: Sam Smoot Date: 2007-01-17T05:20:13+09:00 Subject: Re: Can anyone try to solve this problems? Here's my try at a Ruby 1.8 implementation of the Enumerable#max_by: > a = %w{ one two three four } > def a.max_by > pairs = inject({}) do |hash, obj| > hash[yield obj] = obj; hash > end > pairs[pairs.keys.max] > end > require 'facet/symbol/to_proc' > a.max_by &:size => "three"