D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
Array
/
Filename :
min-i.ri
back
Copy
U:RDoc::AnyMethod[iI"min:ETI"Array#min;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I""Returns one of the following:;To:RDoc::Markup::BlankLine o:RDoc::Markup::List: @type:BULLET:@items[o:RDoc::Markup::ListItem:@label0; [o; ; [I",The minimum-valued element from +self+.;To;;0; [o; ; [I"8A new array of minimum-valued elements from +self+.;T@o; ; [I"Does not modify +self+.;T@o; ; [I"VWith no block given, each element in +self+ must respond to method <tt>#<=></tt> ;TI"with a numeric.;T@o; ; [I"BWith no argument and no block, returns the element in +self+ ;TI"7having the minimum value per method <tt>#<=></tt>:;T@o:RDoc::Markup::Verbatim; [I"[1, 0, 3, 2].min # => 0 ;T:@format0o; ; [I">With non-negative numeric argument +count+ and no block, ;TI"8returns a new array with at most +count+ elements, ;TI"2in ascending order, per method <tt>#<=></tt>:;T@o;; [ I"*[1, 0, 3, 2].min(3) # => [0, 1, 2] ;TI"*[1, 0, 3, 2].min(3.0) # => [0, 1, 2] ;TI"-[1, 0, 3, 2].min(9) # => [0, 1, 2, 3] ;TI"#[1, 0, 3, 2].min(0) # => [] ;T;0o; ; [I"9With a block given, the block must return a numeric.;T@o; ; [I"eWith a block and no argument, calls the block <tt>self.size - 1</tt> times to compare elements; ;TI"@returns the element having the minimum value per the block:;T@o;; [I"<['0', '', '000', '00'].min {|a, b| a.size <=> b.size } ;TI" # => "" ;T;0o; ; [I"=With non-negative numeric argument +count+ and a block, ;TI"8returns a new array with at most +count+ elements, ;TI"'in ascending order, per the block:;T@o;; [I"?['0', '', '000', '00'].min(2) {|a, b| a.size <=> b.size } ;TI"# => ["", "0"] ;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"omin -> element min(count) -> new_array min {|a, b| ... } -> element min(count) {|a, b| ... } -> new_array ;T0[ I"(*args);T@KFI" Array;TcRDoc::NormalClass00