From: Sebastian Hungerecker Date: 2008-08-11T03:25:30+09:00 Subject: Re: why does the initialize method not return the last expression? aidy wrote: > In Ruby the last expression in a method is returned. > > Why is this not the case for the initialize method? It is. class Foo def initialize() 5 end end foo = Foo.send :allocate foo.send :initialize #=> 5 So you see that initialize does indeed return 5 here. Foo.new however will not return 5. This is quite simply due to the fact that new explicitly returns the newly created object, i.e. the call to initialize is not the last thing in new, so it's not the return value of new. HTH, Sebastian -- Jabber: sepp2k@jabber.org ICQ: 205544826