From: Robert Klemme Date: 2007-10-10T19:51:52+09:00 Subject: Re: object to class... 2007/10/10, Pokkai Dokkai : > Sylvain Joyeux wrote: > > On Wednesday 10 October 2007, Pokkai Dokkai wrote: > >> is it possible to convert from a ruby object to Ruby class... > >> any idea..... > > What do you exactly have in mind ? Ruby classes are already Ruby > > objects ... so if you need to manipulate classes as objects you already > > can > > > > obj = Class.new > > > > > > > > instance = obj.new > > > > Sylvain > > source code here > --------------------- > class Name > def initialize > end > ..... > end > ----------------------- > > obj=Name.new > > now my question is ,how to create above source code ?. If you want to create the class definition source code when having an instance only there is no way - at least no standard way. You would have to dig into the Ruby interpreter to do that. robert