From: Demonic Software Date: 2008-03-03T23:49:23+09:00 Subject: Re: Complete Serialization Options ------=_Part_13445_476159.1204555768079 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Thanks Robert. I understand the security issues behind what I am doing. I have some follow-up questions to my previous ones. Is there a centralized structure that holds all the methods, instance variables, and then all the ancestor methods, instance variables, etc. For example, in Python there is self.__dict__, which is basically a hash table and it holds all the basic structures that make up the object in question. Now, I know this is not Python, but I was wondering if Ruby had a hash table or similar object that holds this type of information. Also, is there something (e.g. a manual, guide, paper ) that discusses the *under-the-hood* layout and function of Ruby structures once they are created? I am trying to understand what I can and can not do with the Ruby Language :) Thanks in advance. On Mon, Mar 3, 2008 at 3:52 AM, Robert Klemme wrote: > 2008/3/3, Demonic Software : > > Is there a way to *completely* serialize objects and move them to > > another machien in Ruby? I would like to be able to serialize an > entire > > object (e.g. all the methods, objects, etc.), then transfer this > > serialized object to another interpreter session, which may or may not > > be on the same machine, and deserialize the object. The objective I > > have in mind is to be able to migrate the object into the other session > > and use it as if it was on the instantiated in that session. > > > > I have read about Marshal and YAML, and these two options don't seem to > > have that capability. Are these the only two options for serialization > > in Ruby? > > AFAIK yes. Note that there is usually no access to code so you would > need to employ some tricks to transfer the code (methods) that is > associated with an instance. Note also that you might introduce > security risks and other sorts of weird behavior by allowing code to > be transferred (just think of different versions of the same class > etc.). > > Kind regards > > robert > > -- > use.inject do |as, often| as.you_can - without end > > ------=_Part_13445_476159.1204555768079--