From: nobu.nokada@... Date: 2002-09-27T18:35:49+09:00 Subject: Re: adding overload to ruby Hi, At Fri, 27 Sep 2002 07:00:11 +0900, Mauricio =?unknown-8bit?Q?Fern=E1ndez?= wrote: > One foolish way I can think of would be the following: > > def do_foo(b) > # used when b can respond to sort and bar > end > > def do_foo(b) > # when it has method each > end What about this? ;) def do_foo(b {b.respond_to?(:sort) && b.respond_to?(:bar)}) end -- Nobu Nakada