From: Roger Pack Date: 2008-11-21T08:46:13+09:00 Subject: Re: question about initialize >> Why is the constructor method named initialize? Why not name it new >> to be >> consistent? > Typically, :new is a class method, which calls the instantiated > object's :initialize instance method, if one is available, with the > parameters passed to :new. > You can override the class method :new (this is a good place to use > super), but be sure to return the newly minted object. Often you can > just override the :initialize instance method, however. > > If there's no :new class method in your class definition, then you're > getting Object.new (or some other super class's :new). Would it be better to have initialize called 'on_new' so that the connection is more firm? Thoughts? -=R -- Posted via http://www.ruby-forum.com/.