diff options
author | universato <universato@gmail.com> | 2021-05-06 07:46:57 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2021-08-31 20:56:52 +0900 |
commit | b6691e97374011dce31153295f47b617d7e2819b (patch) | |
tree | 030680c12362744de6cb4823fa9ea3d4cbe2b8e4 /array.c | |
parent | 3ffca65047d67cd958a424ba6dcc55112cc39e0a (diff) | |
download | ruby-b6691e97374011dce31153295f47b617d7e2819b.tar.gz |
Fix a code in the Array#min documentation.
Diffstat (limited to 'array.c')
-rw-r--r-- | array.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -5921,8 +5921,7 @@ ary_min_opt_string(VALUE ary, long i, VALUE vmin) * * With an argument +n+ and a block, returns a new \Array with at most +n+ elements, * in ascending order per the block: - * [0, 1, 2, 3].min(3) # => [0, 1, 2] - * [0, 1, 2, 3].min(6) # => [0, 1, 2, 3] + * ['0', '00', '000'].min(2) {|a, b| a.size <=> b.size } # => ["0", "00"] */ static VALUE rb_ary_min(int argc, VALUE *argv, VALUE ary) |