From: matz@... (Yukihiro Matsumoto) Date: 2001-05-02T12:15:56+09:00 Subject: [ruby-talk:14530] Re: Overloading Constructors. Hi, In message "[ruby-talk:14527] Re: Overloading Constructors." on 01/05/02, "Florian G. Pflug" writes: |> Oops, I forgot that initialize was private method. |> conn.__send__(:initialize, *args) |> or |> conn.instance_eval{initialize(*args)} |> |> would do. Just "initialize" would invoke the method of the |> DbConnection class. |Why? Because the "self" within "new" is class DbConnection, not an INSTANCE of DbConnection. Plain "initialize" calls the method of the receiver (this case DbConnection itself). I hope I explained clearly. |Even if this is the case normally (this would make sense, given that all |methods are what is kind "virtual" in c++), this seems to be exactly the |place where the Mysql-Constructor fails. Otherwise it wouldn't be necessary |to overload "new", but I could just overload "initialize".) "class methods" work differently in Ruby and C++. matz.