From: Rohan Dey Date: 2007-05-29T19:15:31+09:00 Subject: Re: Overriding to_s unknown wrote: > Hi, > > I'm playing around with ruby trying to understand whats going on, and > here is something I don't understand. > > class ZNum > def initialize(n) > @n=n > end > def to_s > self.class > end > end > > n = ZNum.new(1234) > > puts n # prints # > puts n.to_s # prints ZNum > > In both cases it uses ZNum#to_s, but the results are different. Why? > > /kim Not able to understand what you are actually asking. Can you put little detail on this. -- Posted via http://www.ruby-forum.com/.