From: Luk Mus Date: 2011-04-05T17:02:26+09:00 Subject: Autoconvert object from one class1 to other class2 in class1 def Is it possible to convert from one Class1 to another Class2 within the functions of the Class1? Example: class String def to_i! self=self.to_i end end c='1' # c='1' - String c.to_i! # c=1 - Integer Previous code is wrong, error: Can't change the value of self self=self.to_i -- Posted via http://www.ruby-forum.com/.