From: Eric Mahurin Date: 2005-05-11T04:53:13+09:00 Subject: Re: a class that looks like (kind_of?) several classes > > Thanks. I assumed that the StringIO class inherited from > the > > IO class since it has all of the same methods. So the > proper > > Ruby style is to use respond_to? instead of kind_of? to see > > what "type" your arguments are? > > The common Ruby style is to not check at all, but just send > the messages > needed to get the job done. If the object is inappropriate, > Ruby will > catch it and let you know what it didn't like. I was referring to the case when a method does different things based on the argument "types" (i.e. String#[]=). I'll just start using "respond_to?" instead. I was using both. __________________________________ Yahoo! Mail Mobile Take Yahoo! Mail with you! Check email on your mobile phone. http://mobile.yahoo.com/learn/mail