ruby-changes:67508
From: universato <ko1@a...>
Date: Tue, 31 Aug 2021 20:57:04 +0900 (JST)
Subject: [ruby-changes:67508] b6691e9737 (master): Fix a code in the Array#min documentation.
https://git.ruby-lang.org/ruby.git/commit/?id=b6691e9737 From b6691e97374011dce31153295f47b617d7e2819b Mon Sep 17 00:00:00 2001 From: universato <universato@g...> Date: Thu, 6 May 2021 07:46:57 +0900 Subject: Fix a code in the Array#min documentation. --- array.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/array.c b/array.c index edac216..34fdc7b 100644 --- a/array.c +++ b/array.c @@ -5921,8 +5921,7 @@ ary_min_opt_string(VALUE ary, long i, VALUE vmin) https://github.com/ruby/ruby/blob/trunk/array.c#L5921 * * 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) -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/