📁 File Manager Pro
v10.0.3 | PHP: 8.1.34
Server: Apache
2026-06-22 03:06:59
📂
/ (Root)
/
opt
/
alt
/
ruby30
/
share
/
ri
/
system
/
Array
📍 /opt/alt/ruby30/share/ri/system/Array
🔄 Refresh
✏️
Editing: take_while-i.ri
Read Only
U:RDoc::AnyMethod[iI"take_while:ETI"Array#take_while;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"NReturns a new \Array containing zero or more leading elements of +self+; ;TI"does not modify +self+.;To:RDoc::Markup::BlankLine o; ; [I"QWith a block given, calls the block with each successive element of +self+; ;TI"2stops if the block returns +false+ or +nil+; ;TI"_returns a new Array containing those elements for which the block returned a truthy value:;To:RDoc::Markup::Verbatim; [ I"a = [0, 1, 2, 3, 4, 5] ;TI":a.take_while {|element| element < 3 } # => [0, 1, 2] ;TI"<a.take_while {|element| true } # => [0, 1, 2, 3, 4, 5] ;TI"a # => [0, 1, 2, 3, 4, 5] ;T:@format0o; ; [I"4With no block given, returns a new \Enumerator:;To;; [I"<[0, 1].take_while # => #<Enumerator: [0, 1]:take_while>;T; 0: @fileI"array.c;T:0@omit_headings_from_table_of_contents_below0I"Warray.take_while {|element| ... } -> new_array array.take_while -> new_enumerator ;T0[ I"();T@!FI" Array;TcRDoc::NormalClass00
💾 Save Changes
❌ Cancel