PATH:
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
Range
U:RDoc::AnyMethod[iI"minmax:ETI"Range#minmax;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"SReturns a 2-element array containing the minimum and maximum value in +self+, ;TI"Jeither according to comparison method <tt>#<=></tt> or a given block.;To:RDoc::Markup::BlankLine o; ; [I"BWith no block given, returns the minimum and maximum values, ;TI"(using <tt>#<=></tt> for comparison:;T@o:RDoc::Markup::Verbatim; [ I"#(1..4).minmax # => [1, 4] ;TI"#(1...4).minmax # => [1, 3] ;TI"'('a'..'d').minmax # => ["a", "d"] ;TI"%(-4..-1).minmax # => [-4, -1] ;T:@format0o; ; [I":With a block given, the block must return an integer:;T@o:RDoc::Markup::List: @type:BULLET:@items[o:RDoc::Markup::ListItem:@label0; [o; ; [I")Negative if +a+ is smaller than +b+.;To;;0; [o; ; [I"#Zero if +a+ and +b+ are equal.;To;;0; [o; ; [I"(Positive if +a+ is larger than +b+.;T@o; ; [I"GThe block is called <tt>self.size</tt> times to compare elements; ;TI"Vreturns a 2-element Array containing the minimum and maximum values from +self+, ;TI"per the block:;T@o;; [I"4(1..4).minmax {|a, b| -(a <=> b) } # => [4, 1] ;T; 0o; ; [I"$Returns <tt>[nil, nil]</tt> if:;T@o;;;;[o;;0; [o; ; [I"?The begin value of the range is larger than the end value:;T@o;; [I"8(4..1).minmax # => [nil, nil] ;TI"8(4..1).minmax {|a, b| -(a <=> b) } # => [nil, nil] ;T; 0o;;0; [o; ; [I"EThe begin value of an exclusive range is equal to the end value:;T@o;; [I"=(1...1).minmax # => [nil, nil] ;TI"=(1...1).minmax {|a, b| -(a <=> b) } # => [nil, nil] ;T; 0o; ; [I"FRaises an exception if +self+ is a beginless or an endless range.;T@o; ; [I"#Related: Range#min, Range#max.;T: @fileI"range.c;T:0@omit_headings_from_table_of_contents_below0I"Iminmax -> [object, object] minmax {|a, b| ... } -> [object, object] ;T0[ I"();T@SFI" Range;TcRDoc::NormalClass00
[-] last-i.ri
[edit]
[-] include%3f-i.ri
[edit]
[-] count-i.ri
[edit]
[-] size-i.ri
[edit]
[-] bsearch-i.ri
[edit]
[-] end-i.ri
[edit]
[-] to_s-i.ri
[edit]
[-] max-i.ri
[edit]
[-] to_json-i.ri
[edit]
[-] first-i.ri
[edit]
[-] as_json-i.ri
[edit]
[-] reverse_each-i.ri
[edit]
[-] cover%3f-i.ri
[edit]
[-] to_a-i.ri
[edit]
[-] new-c.ri
[edit]
[-] minmax-i.ri
[edit]
[-] json_create-c.ri
[edit]
[-] min-i.ri
[edit]
[-] hash-i.ri
[edit]
[-] each-i.ri
[edit]
[-] step-i.ri
[edit]
[-] %3d%3d%3d-i.ri
[edit]
[-] eql%3f-i.ri
[edit]
[-] cdesc-Range.ri
[edit]
[-] member%3f-i.ri
[edit]
[-] %25-i.ri
[edit]
[-] exclude_end%3f-i.ri
[edit]
[-] begin-i.ri
[edit]
[-] overlap%3f-i.ri
[edit]
[+]
..
[-] entries-i.ri
[edit]
[-] %3d%3d-i.ri
[edit]
[-] inspect-i.ri
[edit]