From 752c88bab3239e9cd52e5a56a55fc10d3a464b82 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Mon, 9 Feb 2026 21:17:10 -0500 Subject: [DOC] Fix hash style for Array#flatten --- array.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'array.c') diff --git a/array.c b/array.c index 0eb4c45370..1b2e395bce 100644 --- a/array.c +++ b/array.c @@ -6803,17 +6803,17 @@ rb_ary_flatten_bang(int argc, VALUE *argv, VALUE ary) * With non-negative integer argument +depth+, flattens recursively through +depth+ levels: * * a = [ 0, [ 1, [2, 3], 4 ], 5, {foo: 0}, Set.new([6, 7]) ] - * a # => [0, [1, [2, 3], 4], 5, {:foo=>0}, #] - * a.flatten(0) # => [0, [1, [2, 3], 4], 5, {:foo=>0}, #] - * a.flatten(1 ) # => [0, 1, [2, 3], 4, 5, {:foo=>0}, #] - * a.flatten(1.1) # => [0, 1, [2, 3], 4, 5, {:foo=>0}, #] - * a.flatten(2) # => [0, 1, 2, 3, 4, 5, {:foo=>0}, #] - * a.flatten(3) # => [0, 1, 2, 3, 4, 5, {:foo=>0}, #] + * a # => [0, [1, [2, 3], 4], 5, {foo: 0}, #] + * a.flatten(0) # => [0, [1, [2, 3], 4], 5, {foo: 0}, #] + * a.flatten(1 ) # => [0, 1, [2, 3], 4, 5, {foo: 0}, #] + * a.flatten(1.1) # => [0, 1, [2, 3], 4, 5, {foo: 0}, #] + * a.flatten(2) # => [0, 1, 2, 3, 4, 5, {foo: 0}, #] + * a.flatten(3) # => [0, 1, 2, 3, 4, 5, {foo: 0}, #] * * With +nil+ or negative +depth+, flattens all levels. * - * a.flatten # => [0, 1, 2, 3, 4, 5, {:foo=>0}, #] - * a.flatten(-1) # => [0, 1, 2, 3, 4, 5, {:foo=>0}, #] + * a.flatten # => [0, 1, 2, 3, 4, 5, {foo: 0}, #] + * a.flatten(-1) # => [0, 1, 2, 3, 4, 5, {foo: 0}, #] * * Related: Array#flatten!; * see also {Methods for Converting}[rdoc-ref:Array@Methods+for+Converting]. -- cgit v1.2.3