Ruby/Array/max by
Материал из Wiki.crossplatform.ru
Версия от 17:10, 26 мая 2010; (Обсуждение)
max_by with block
langs = %w[java perl python ruby] # Which has the longest name? langs.max_by {|word| word.length } # => "python": Ruby 1.9 only