| Server IP : 162.214.74.102 / Your IP : 216.73.217.21 Web Server : Apache System : Linux dedi-4363141.lrsys.com.br 3.10.0-1160.119.1.el7.tuxcare.els25.x86_64 #1 SMP Wed Oct 1 17:37:27 UTC 2025 x86_64 User : lrsys ( 1015) PHP Version : 5.6.40 Disable Function : exec,passthru,shell_exec,system MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /proc/self/root/opt/cpanel/ea-ruby24/root/usr/share/ri/system/Enumerable/ |
Upload File : |
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