diff --git a/array.c b/array.c index cb6d06cc5f..b85069a599 100644 --- a/array.c +++ b/array.c @@ -5624,23 +5624,23 @@ rb_ary_and(VALUE ary1, VALUE ary2) /* * call-seq: - * array.intersection(*other_arrays) -> new_array + * intersection(*other_arrays) -> new_array * - * Returns a new +Array+ containing each element found both in +self+ - * and in all of the given Arrays +other_arrays+; - * duplicates are omitted; items are compared using eql? - * (items must also implement +hash+ correctly): + * Returns a new array containing each element in +self+ that is +#eql?+ + * to at least one element in each of the given +other_arrays+; + * duplicates are omitted: * - * [0, 1, 2, 3].intersection([0, 1, 2], [0, 1, 3]) # => [0, 1] * [0, 0, 1, 1, 2, 3].intersection([0, 1, 2], [0, 1, 3]) # => [0, 1] * - * Preserves order from +self+: + * Each element must correctly implement method #hash. + * + * Order from +self+ is preserved: * * [0, 1, 2].intersection([2, 1, 0]) # => [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: see {Methods for Combining}[rdoc-ref:Array@Methods+for+Combining]. */ static VALUE