Linux heracles.o2switch.net 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
/
opt
/
alt
/
ruby21
/
share
/
ri
/
2.1.0
/
system
/
Array
/
//opt/alt/ruby21/share/ri/2.1.0/system/Array/sort-i.ri
U:RDoc::AnyMethod[iI" sort:ETI"Array#sort;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"3Returns a new array created by sorting +self+.;To:RDoc::Markup::BlankLine o; ; [I"OComparisons for the sort will be done using the <code><=></code> operator ;TI"%or using an optional code block.;T@o; ; [I"KThe block must implement a comparison between +a+ and +b+, and return ;TI"N+-1+, when +a+ follows +b+, +0+ when +a+ and +b+ are equivalent, or ++1+ ;TI"if +b+ follows +a+.;T@o; ; [I"!See also Enumerable#sort_by.;T@o:RDoc::Markup::Verbatim; [I"%a = [ "d", "a", "e", "c", "b" ] ;TI"=a.sort #=> ["a", "b", "c", "d", "e"] ;TI"<a.sort { |x,y| y <=> x } #=> ["e", "d", "c", "b", "a"];T:@format0: @fileI"array.c;T:0@omit_headings_from_table_of_contents_below0I"Qary.sort -> new_ary ary.sort { |a, b| block } -> new_ary ;T0[ I"();T@ FI" Array;TcRDoc::NormalClass00