From 7ec51310d510ac8b46a7815e49bf8098a8957300 Mon Sep 17 00:00:00 2001 From: BurdetteLamar Date: Mon, 9 Sep 2024 09:45:50 -0500 Subject: [PATCH] [DOC] Related for Array#cycle --- array.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/array.c b/array.c index 0b79f6aede..982e5741bd 100644 --- a/array.c +++ b/array.c @@ -6815,7 +6815,7 @@ rb_ary_cycle_size(VALUE self, VALUE args, VALUE eobj) * {integer-convertible object}[rdoc-ref:implicit_conversion.rdoc@Integer-Convertible+Objects], * or +nil+. * - * If +count+ is positive, + * When +count+ is positive, * calls the block with each element, then does so repeatedly, * until it has done so +count+ times; returns +nil+: * @@ -6823,18 +6823,20 @@ rb_ary_cycle_size(VALUE self, VALUE args, VALUE eobj) * [0, 1].cycle(2) {|element| output.push(element) } # => nil * output # => [0, 1, 0, 1] * - * If +count+ is zero or negative, does not call the block: + * When +count+ is zero or negative, does not call the block: * * [0, 1].cycle(0) {|element| fail 'Cannot happen' } # => nil * [0, 1].cycle(-1) {|element| fail 'Cannot happen' } # => nil * - * If +count+ is +nil+, cycles forever: + * When +count+ is +nil+, cycles forever: * * # Prints 0 and 1 forever. * [0, 1].cycle {|element| puts element } * [0, 1].cycle(nil) {|element| puts element } * * With no block given, returns a new Enumerator. + * + * Related: see {Methods for Iterating}[rdoc-ref:Array@Methods+for+Iterating]. */ static VALUE rb_ary_cycle(int argc, VALUE *argv, VALUE ary)