From: Drew Olson Date: 2007-05-17T04:27:38+09:00 Subject: Re: Some Ruby Features missing... Drew Olson wrote: > Adriano Ferreira wrote: >> You're missing "to_s" >> >> $ irb >> irb> class Foo; end >> => nil >> irb> Foo.new >> => # <-- default stringification >> >> irb> class Foo; def to_s; "a Foo"; end end >> => nil >> irb> Foo.new >> => a Foo <-- customized stringification >> >> irb> quit > > This is a little nit-picky, but this code won't actually work unless > you've modified irb Whoops, I take that back, I was unaware that creating an instance of an object called #to_s in irb. However, I think demonstrating printing an instance makes a bit more sense here. My bad! -Drew -- Posted via http://www.ruby-forum.com/.