From: ts Date: 2003-11-18T21:53:24+09:00 Subject: Re: testing argument type and duck typing, newbie question >>>>> "R" == Raphael Bauduin writes: R> I have a method taking one argument that can be an integer or a string. R> How do I test the argument to know if it's a string or an integer? All R> the duck typing things I've read make me wonder what's the best way R> to determine if the argument is an integer or a string..... Well, it really demand on what you want to do. One possibility is to call the global function Integer, if it give an error you have possibly a String : now you can call #to_str on this object (if you want catch some errors) or you can convert your argument to a String by calling #to_s Guy Decoux