From c7faffd1d6013a840d5286312cd08790c0e0e69a Mon Sep 17 00:00:00 2001 From: BurdetteLamar Date: Wed, 11 Sep 2024 08:08:06 -0500 Subject: [PATCH] [DOC] Tweaks for Array#drop_while --- array.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/array.c b/array.c index 920eda4d70..64a5f16938 100644 --- a/array.c +++ b/array.c @@ -7731,23 +7731,20 @@ rb_ary_drop(VALUE ary, VALUE n) /* * call-seq: - * array.drop_while {|element| ... } -> new_array - * array.drop_while -> new_enumerator - - * Returns a new +Array+ containing zero or more trailing elements of +self+; - * does not modify +self+. + * drop_while {|element| ... } -> new_array + * drop_while -> new_enumerator * * With a block given, calls the block with each successive element of +self+; * stops if the block returns +false+ or +nil+; - * returns a new +Array+ _omitting_ those elements for which the block returned a truthy value: + * returns a new array _omitting_ those elements for which the block returned a truthy value; + * does not modify +self+: * * a = [0, 1, 2, 3, 4, 5] * a.drop_while {|element| element < 3 } # => [3, 4, 5] * - * With no block given, returns a new Enumerator: - * - * [0, 1].drop_while # => # => # + * With no block given, returns a new Enumerator. * + * Related: see {Methods for Fetching}[rdoc-ref:Array@Methods+for+Fetching]. */ static VALUE