D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
Array
/
Filename :
minmax-i.ri
back
Copy
U:RDoc::AnyMethod[iI"minmax:ETI"Array#minmax;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"PReturns a 2-element array containing the minimum-valued and maximum-valued ;TI"elements from +self+; ;TI"does not modify +self+.;To:RDoc::Markup::BlankLine o; ; [I"cWith no block given, the minimum and maximum values are determined using method <tt>#<=></tt>:;T@o:RDoc::Markup::Verbatim; [I"%[1, 0, 3, 2].minmax # => [0, 3] ;T:@format0o; ; [I":With a block given, the block must return a numeric; ;TI"Kthe block is called <tt>self.size - 1</tt> times to compare elements; ;TI"Nreturns the elements having the minimum and maximum values per the block:;T@o;; [I"?['0', '', '000', '00'].minmax {|a, b| a.size <=> b.size } ;TI"# => ["", "000"] ;T; 0o; ; [I"NRelated: see {Methods for Fetching}[rdoc-ref:Array@Methods+for+Fetching].;T: @fileI"array.c;T:0@omit_headings_from_table_of_contents_below0I"3minmax -> array minmax {|a, b| ... } -> array ;T0[ I"();T@#FI" Array;TcRDoc::NormalClass00