From: Robert Klemme Date: 2004-09-17T21:39:46+09:00 Subject: Re: Automatic class conversion / function overloading "trans. (T. Onoma)" schrieb im Newsbeitrag news:200409170811.02268.transami@runbox.com... > On Friday 17 September 2004 07:52 am, Brian Candler wrote: > > Actually, you're often more interested in what methods an object responds > > to, rather than its class. In the logger example you're more likely to have > > > > logger.flush if logger.respond_to?(:flush) > > Exactly! This is a good practice to get in too. Not generally. In the light of duck typing you normally just invoke methods and get bitten by an exception. Of course, if you plan to use objects as arguments that support or don't support #flush that might be the only feasible approach. Kind regards robert