[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: a class that looks like (kind_of?) several classes

Eric Mahurin

5/10/2005 7:53:00 PM

> > 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/...


1 Answer

dblack

5/18/2005 4:26:00 PM

0