From: Brian Candler Date: 2011-04-05T17:46:32+09:00 Subject: Re: Autoconvert object from one class1 to other class2 in class1 def Luk Mus wrote in post #990946: > Is it possible to convert from one Class1 to another Class2 within the > functions of the Class1? No, an object cannot change its class. All you can do is return a new object of a different class. > or how get name of variable in class method? That's not possible either. The same object could be pointed to by many variables (local and/or global and/or instance), or by none. For example, maybe the only reference to the object is as a value in a Hash. -- Posted via http://www.ruby-forum.com/.