diff options
| author | dave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-12-29 03:56:22 +0000 |
|---|---|---|
| committer | dave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-12-29 03:56:22 +0000 |
| commit | 799ac5b1b27fee497dd3b9f133cbef33058811e4 (patch) | |
| tree | 9b06164a3e7662cd4bcdb49854cf1ac9ace1d291 /enum.c | |
| parent | cf8415edbbc810076ddb11b9de441f9a36bfccb5 (diff) | |
| download | ruby-799ac5b1b27fee497dd3b9f133cbef33058811e4.tar.gz ruby-799ac5b1b27fee497dd3b9f133cbef33058811e4.tar.xz ruby-799ac5b1b27fee497dd3b9f133cbef33058811e4.zip | |
Add RDoc for Kernel global functions, tidy array and error
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@5343 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enum.c')
| -rw-r--r-- | enum.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -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; |
