Skip to content

Commit 3719b3d

Browse files
[DOC] Tweaks to Array#- (#11303)
1 parent 2a31410 commit 3719b3d

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

array.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5408,16 +5408,18 @@ ary_make_hash_by(VALUE ary)
54085408

54095409
/*
54105410
* call-seq:
5411-
* array - other_array -> new_array
5411+
* self - other_array -> new_array
54125412
*
5413-
* Returns a new +Array+ containing only those elements from +array+
5414-
* that are not found in +Array+ +other_array+;
5415-
* items are compared using <tt>eql?</tt>;
5416-
* the order from +array+ is preserved:
5413+
* Returns a new array containing only those elements of +self+
5414+
* that are not found in +other_array+;
5415+
* the order from +self+ is preserved:
54175416
*
5418-
* [0, 1, 1, 2, 1, 1, 3, 1, 1] - [1] # => [0, 2, 3]
5419-
* [0, 1, 2, 3] - [3, 0] # => [1, 2]
5420-
* [0, 1, 2] - [4] # => [0, 1, 2]
5417+
* [0, 1, 1, 2, 1, 1, 3, 1, 1] - [1] # => [0, 2, 3]
5418+
* [0, 1, 1, 2, 1, 1, 3, 1, 1] - [3, 2, 0, :foo] # => [1, 1, 1, 1, 1, 1]
5419+
* [0, 1, 2] - [:foo] # => [0, 1, 2]
5420+
*
5421+
* Element are compared using method <tt>#eql?</tt>
5422+
* (as defined in each element of +self+).
54215423
*
54225424
* Related: Array#difference.
54235425
*/

0 commit comments

Comments
 (0)