⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.133
Server IP:
185.119.109.197
Server:
Linux managedhosting.chostar.me 5.15.0-160-generic #170-Ubuntu SMP Wed Oct 1 10:06:56 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
8.1.33
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
proc
/
self
/
root
/
usr
/
share
/
ri
/
3.0.0
/
system
/
Array
/
View File Name :
one%3f-i.ri
U:RDoc::AnyMethod[iI" one?:ETI"Array#one?;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"MReturns +true+ if exactly one element of +self+ meets a given criterion.;To:RDoc::Markup::BlankLine o; ; [I"cWith no block given and no argument, returns +true+ if +self+ has exactly one truthy element, ;TI"+false+ otherwise:;To:RDoc::Markup::Verbatim; [ I"[nil, 0].one? # => true ;TI"[0, 0].one? # => false ;TI" [nil, nil].one? # => false ;TI"[].one? # => false ;T:@format0o; ; [I"VWith a block given and no argument, calls the block with each element in +self+; ;TI"[returns +true+ if the block a truthy value for exactly one element, +false+ otherwise:;To;; [I"8[0, 1, 2].one? {|element| element > 0 } # => false ;TI"7[0, 1, 2].one? {|element| element > 1 } # => true ;TI"8[0, 1, 2].one? {|element| element > 2 } # => false ;T; 0o; ; [I"YIf argument +obj+ is given, returns +true+ if
obj.===
exactly one element, ;TI"+false+ otherwise:;To;; [I"![0, 1, 2].one?(0) # => true ;TI""[0, 0, 1].one?(0) # => false ;TI""[1, 1, 2].one?(0) # => false ;TI".['food', 'drink'].one?(/bar/) # => false ;TI"-['food', 'drink'].one?(/foo/) # => true ;TI"[].one?(/foo/) # => false ;T; 0o; ; [I"Related: Enumerable#one?;T: @fileI"array.c;T:0@omit_headings_from_table_of_contents_below0I"oarray.one? -> true or false array.one? {|element| ... } -> true or false array.one?(obj) -> true or false ;T0[ I"(*args);T@1FI" Array;TcRDoc::NormalClass00