[DOC] Tweaks for Array#none? (#11788)
This commit is contained in:
parent
b57bbf774f
commit
87169dd435
Notes:
git
2024-10-04 20:11:28 +00:00
Merged-By: peterzhu2118 <peter@peterzhu.ca>
25
array.c
25
array.c
@ -7912,11 +7912,11 @@ rb_ary_all_p(int argc, VALUE *argv, VALUE ary)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* array.none? -> true or false
|
* none? -> true or false
|
||||||
* array.none? {|element| ... } -> true or false
|
* none?(object) -> true or false
|
||||||
* array.none?(obj) -> true or false
|
* none? {|element| ... } -> true or false
|
||||||
*
|
*
|
||||||
* Returns +true+ if no element of +self+ meet a given criterion.
|
* Returns +true+ if no element of +self+ meets a given criterion, +false+ otherwise.
|
||||||
*
|
*
|
||||||
* With no block given and no argument, returns +true+ if +self+ has no truthy elements,
|
* With no block given and no argument, returns +true+ if +self+ has no truthy elements,
|
||||||
* +false+ otherwise:
|
* +false+ otherwise:
|
||||||
@ -7925,13 +7925,8 @@ rb_ary_all_p(int argc, VALUE *argv, VALUE ary)
|
|||||||
* [nil, 0, false].none? # => false
|
* [nil, 0, false].none? # => false
|
||||||
* [].none? # => true
|
* [].none? # => true
|
||||||
*
|
*
|
||||||
* With a block given and no argument, calls the block with each element in +self+;
|
* With argument +object+ given, returns +false+ if for any element +element+,
|
||||||
* returns +true+ if the block returns no truthy value, +false+ otherwise:
|
* <tt>object === element</tt>; +true+ otherwise:
|
||||||
*
|
|
||||||
* [0, 1, 2].none? {|element| element > 3 } # => true
|
|
||||||
* [0, 1, 2].none? {|element| element > 1 } # => false
|
|
||||||
*
|
|
||||||
* If argument +obj+ is given, returns +true+ if <tt>obj.===</tt> no element, +false+ otherwise:
|
|
||||||
*
|
*
|
||||||
* ['food', 'drink'].none?(/bar/) # => true
|
* ['food', 'drink'].none?(/bar/) # => true
|
||||||
* ['food', 'drink'].none?(/foo/) # => false
|
* ['food', 'drink'].none?(/foo/) # => false
|
||||||
@ -7939,7 +7934,13 @@ rb_ary_all_p(int argc, VALUE *argv, VALUE ary)
|
|||||||
* [0, 1, 2].none?(3) # => true
|
* [0, 1, 2].none?(3) # => true
|
||||||
* [0, 1, 2].none?(1) # => false
|
* [0, 1, 2].none?(1) # => false
|
||||||
*
|
*
|
||||||
* Related: Enumerable#none?
|
* With a block given, calls the block with each element in +self+;
|
||||||
|
* returns +true+ if the block returns no truthy value, +false+ otherwise:
|
||||||
|
*
|
||||||
|
* [0, 1, 2].none? {|element| element > 3 } # => true
|
||||||
|
* [0, 1, 2].none? {|element| element > 1 } # => false
|
||||||
|
*
|
||||||
|
* Related: see {Methods for Querying}[rdoc-ref:Array@Methods+for+Querying].
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user