summaryrefslogtreecommitdiff
path: root/enum.c
diff options
context:
space:
mode:
authordave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-12-29 03:56:22 +0000
committerdave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-12-29 03:56:22 +0000
commitd50547c22c5a884d90d434adef20a9217d88da22 (patch)
tree9b06164a3e7662cd4bcdb49854cf1ac9ace1d291 /enum.c
parent685a063a15d8f18b2f4c849b1faa1158e614eaba (diff)
Add RDoc for Kernel global functions, tidy array and error
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@5343 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enum.c')
-rw-r--r--enum.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/enum.c b/enum.c
index 28f28cb..ef7fe95 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 <code>Comparable</code>;
+ * the second uses the block to return <em>a <=> b</em>.
+ *
+ * a = %w(albatross dog horse)
+ * a.max #=> "horse"
+ * a.max {|a,b| a.length <=> b.length } #=> "albatross"
+ */
+
static VALUE
enum_max(obj)
VALUE obj;