Logan Capaldo
11/12/2004 2:26:00 AM
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
<masaki.suketa@nifty.ne.jp> wrote:
> Hello,
>
> In message "win32ole and ole_methods"
> on 04/11/10, Daniel Berger <djberg96@hotmail.com> 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
>
>