D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
Enumerable
/
Filename :
uniq-i.ri
back
Copy
U:RDoc::AnyMethod[iI" uniq:ETI"Enumerable#uniq;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"IWith no block, returns a new array containing only unique elements; ;TI"Pthe array has no two elements +e0+ and +e1+ such that <tt>e0.eql?(e1)</tt>:;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I";%w[a b c c b a a b c].uniq # => ["a", "b", "c"] ;TI"5[0, 1, 2, 2, 1, 0, 0, 1, 2].uniq # => [0, 1, 2] ;T:@format0o; ; [I"TWith a block, returns a new array containing elements only for which the block ;TI"returns a unique value:;T@o;; [ I"+a = [0, 1, 2, 3, 4, 5, 5, 4, 3, 2, 1] ;TI"2a.uniq {|i| i.even? ? i : 0 } # => [0, 2, 4] ;TI"+a = %w[a b c d e e d c b a a b c d e] ;TI"2a.uniq {|c| c < 'c' } # => ["a", "c"];T; 0: @fileI"enum.c;T:0@omit_headings_from_table_of_contents_below0I"Cuniq -> array uniq {|element| ... } -> array ;T0[ I"();T@FI"Enumerable;TcRDoc::NormalModule00