[DOC] Tweaks for Array.intersect? (#11744)
This commit is contained in:
parent
a7c04a317f
commit
609fdde2c9
Notes:
git
2024-10-02 15:12:18 +00:00
Merged-By: peterzhu2118 <peter@peterzhu.ca>
17
array.c
17
array.c
@ -5767,19 +5767,16 @@ rb_ary_union_multi(int argc, VALUE *argv, VALUE ary)
|
||||
|
||||
/*
|
||||
* call-seq:
|
||||
* ary.intersect?(other_ary) -> true or false
|
||||
* intersect?(other_array) -> true or false
|
||||
*
|
||||
* Returns +true+ if the array and +other_ary+ have at least one element in
|
||||
* common, otherwise returns +false+:
|
||||
* Returns whether +other_array+ has at least one element that is +#eql?+ to some element of +self+:
|
||||
*
|
||||
* a = [ 1, 2, 3 ]
|
||||
* b = [ 3, 4, 5 ]
|
||||
* c = [ 5, 6, 7 ]
|
||||
* a.intersect?(b) #=> true
|
||||
* a.intersect?(c) #=> false
|
||||
* [1, 2, 3].intersect?([3, 4, 5]) # => true
|
||||
* [1, 2, 3].intersect?([4, 5, 6]) # => false
|
||||
*
|
||||
* +Array+ elements are compared using <tt>eql?</tt>
|
||||
* (items must also implement +hash+ correctly).
|
||||
* Each element must correctly implement method <tt>#hash</tt>.
|
||||
*
|
||||
* Related: see {Methods for Querying}[rdoc-ref:Array@Methods+for+Querying].
|
||||
*/
|
||||
|
||||
static VALUE
|
||||
|
Loading…
x
Reference in New Issue
Block a user