Ruby/Array/max by
Материал из Wiki.crossplatform.ru
Версия от 18:01, 13 сентября 2010; ViGOur (Обсуждение | вклад)
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