D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
Enumerable
/
Filename :
flat_map-i.ri
back
Copy
U:RDoc::AnyMethod[iI" flat_map:ETI"Enumerable#flat_map;TF:publico:RDoc::Markup::Document:@parts[ o:RDoc::Markup::Paragraph; [I"AReturns an array of flattened objects returned by the block.;To:RDoc::Markup::BlankLine o; ; [I"CWith a block given, calls the block with successive elements; ;TI"@returns a flattened array of objects returned by the block:;T@o:RDoc::Markup::Verbatim; [ I"Y[0, 1, 2, 3].flat_map {|element| -element } # => [0, -1, -2, -3] ;TI"e[0, 1, 2, 3].flat_map {|element| [element, -element] } # => [0, 0, 1, -1, 2, -2, 3, -3] ;TI"`[[0, 1], [2, 3]].flat_map {|e| e + [100] } # => [0, 1, 100, 2, 3, 100] ;TI"e{foo: 0, bar: 1, baz: 2}.flat_map {|key, value| [key, value] } # => [:foo, 0, :bar, 1, :baz, 2] ;T:@format0o; ; [I"0With no block given, returns an Enumerator.;T@o; ; [I"Alias: #collect_concat.;T: @fileI"enum.c;T:0@omit_headings_from_table_of_contents_below0I"?flat_map {|element| ... } -> array flat_map -> enumerator ;T0[[I"collect_concat;T@ I"();T@FI"Enumerable;TcRDoc::NormalModule00