From: matz@... (Yukihiro Matsumoto) Date: 2002-09-06T10:23:38+09:00 Subject: Re: Sort Question Hi, In message "Re: Sort Question" on 02/09/06, Albert Wagner writes: |> I want to sort the array (with these objects in it) by xnum... |ary = [Area_rep.new(1,'a'), Area_rep.new(2,'b'), Area_rep.new(3,'c')] |sortedAry = ary.sort {|a, b| b.xnum <=> a.xnum} If you are using 1.7, you can sortedAry = ary.sort_by {|x| x.xnum} matz.