From: Tomasz Wegrzanowski Date: 2001-12-29T08:12:08+09:00 Subject: [ruby-talk:29598] Re: extending method of class A to support arguments of class B by promoting `self' to class B On Sat, Dec 29, 2001 at 07:59:42AM +0900, Mark Hahn wrote: > > > it should be promoted to Complex > > Is this possible? I've wanted to change an object's type before inside a > method of that object, but I didn't think it was possible. > > Or did you mean "return" a Complex object. That is all you really need to > do in the case you describe. I meant: temporary object of type Complex, initiated by Real object, should be created, and method `*' of this temporary Complex object should be used instead of method `*' of Real object.