From: Logan Capaldo Date: 2004-11-12T11:26:10+09:00 Subject: Re: win32ole and ole_methods That seems a little overkill, why not just some_array.sort { |a, b| a.name <=> b.name } On Thu, 11 Nov 2004 01:11:40 +0900, Masaki Suketa wrote: > Hello, > > In message "win32ole and ole_methods" > on 04/11/10, Daniel Berger writes: > > > Since I just want a list of methods, why not just return an array of > > strings? If we must return WIN32OLE_METHOD objects, can the '<=>' > > operator be defined so that I can sort them? :) > > Because in order to get the other information about the methods. > For example, you can get only the name of the method but also > argument information of the method. > > oleobj.ole_methods.each do |m| > puts m.name > p m.params > end > > You can the '<=>' method as following: > > class WIN32OLE_METHOD > define <=>(other) > name <=> other.name > end > end > > I welcom better idea, or better solution about this. > > Regards > > Masaki Suketa > >