From: John Joyce Date: 2007-10-12T18:37:48+09:00 Subject: Re: object to class... On Oct 10, 2007, at 5:50 AM, Pokkai Dokkai wrote: > source code here > --------------------- > class Name > def initialize > end > ..... > end > ----------------------- > > obj=Name.new > > now my question is ,how to create above source code from obj?. > > actually jruby will create java object to ruby object > but that ruby object(from java object) is not in source code format > > so i am asking this question ...... > -- > Posted via http://www.ruby-forum.com/. > Well, it could be sort of possible, but partly pointless: You could start a ruby process that then loads a file, but before loading, read the file. You could then create objects that contain the code (as a string, probably) for classes in the original file. Then when you ask an object, "what class are you?", you will have a little clipboard (or PDA) to lookup his/her class name and fetch your class_code string. From there it would be possible to alter the class_code string, then re"load" that class into the interpreter... circular? could be pointless? maybe fun? probably