From d993e38f1898a2edf29f304c8aa3b34aceb34c35 Mon Sep 17 00:00:00 2001 From: dave Date: Mon, 29 Dec 2003 03:56:22 +0000 Subject: Add RDoc for Kernel global functions, tidy array and error git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5343 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- enum.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'enum.c') diff --git a/enum.c b/enum.c index 28f28cbd5f..ef7fe951c3 100644 --- a/enum.c +++ b/enum.c @@ -728,6 +728,20 @@ max_ii(i, memo) return Qnil; } +/* + * call-seq: + * enum.max => obj + * enum.max {|a,b| block } => obj + * + * Returns the object in _enum_ with the maximum value. The + * first form assumes all objects implement Comparable; + * the second uses the block to return a <=> b. + * + * a = %w(albatross dog horse) + * a.max #=> "horse" + * a.max {|a,b| a.length <=> b.length } #=> "albatross" + */ + static VALUE enum_max(obj) VALUE obj; -- cgit v1.2.3