Thread
:
Ruby Snippets
View Single Post
Apr 10th, 2006, 3:37 AM
#
11
Arevos
Programming Guru
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power:
5
This probably does the same thing:
(
Toggle Plain Text
)
class Array def max_by(&block) max { |a, b| block.call(a) <=> block.call(b) } end end
class Array def max_by(&block) max { |a, b| block.call(a) <=> block.call(b) } end end
Arevos
View Public Profile
Visit Arevos's homepage!
Find More Posts by Arevos