From 18fb11aaa407feb6677effb0229a9b82806d8b46 Mon Sep 17 00:00:00 2001 From: Burdette Lamar Date: Wed, 11 Sep 2024 12:14:41 -0500 Subject: [DOC] Tweaks for Array#difference (#11593) --- array.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/array.c b/array.c index 64a5f16938..f44af312f2 100644 --- a/array.c +++ b/array.c @@ -5521,19 +5521,21 @@ rb_ary_diff(VALUE ary1, VALUE ary2) /* * call-seq: - * array.difference(*other_arrays) -> new_array + * difference(*other_arrays = []) -> new_array * - * Returns a new +Array+ containing only those elements from +self+ - * that are not found in any of the Arrays +other_arrays+; + * Returns a new array containing only those elements from +self+ + * that are not found in any of the given +other_arrays+; * items are compared using eql?; order from +self+ is preserved: * * [0, 1, 1, 2, 1, 1, 3, 1, 1].difference([1]) # => [0, 2, 3] - * [0, 1, 2, 3].difference([3, 0], [1, 3]) # => [2] - * [0, 1, 2].difference([4]) # => [0, 1, 2] + * [0, 1, 2, 3].difference([3, 0], [1, 3]) # => [2] + * [0, 1, 2].difference([4]) # => [0, 1, 2] + * [0, 1, 2].difference # => [0, 1, 2] * - * Returns a copy of +self+ if no arguments given. + * Returns a copy of +self+ if no arguments are given. * - * Related: Array#-. + * Related: Array#-; + * see also {Methods for Combining}[rdoc-ref:Array@Methods+for+Combining]. */ static VALUE -- cgit v1.2.3