From: "Carlo E. Prelz" Date: 2013-02-02T18:38:38+09:00 Subject: Re: Problem redefining String::to_s Subject: Re: Problem redefining String::to_s Date: sab 02 feb 13 06:21:06 +0900 Quoting sto.mar@web.de (sto.mar@web.de): > Why should to_s be sent to an object that already *is* a string??? The method exists, and it is useful when you code method that expect various parameters, and convert them all to strings. It is not invoked in string expansion (for reasons of optimization, I believe). You can redefine to_s, and then explicitly invoke it, like class String def to_s 'another string' end end 'test'.to_s Carlo -- * Se la Strada e la sua Virtu' non fossero state messe da parte, * K * Carlo E. Prelz - fluido@fluido.as che bisogno ci sarebbe * di parlare tanto di amore e di rettitudine? (Chuang-Tzu)