From: Robert Oliver Date: 2006-10-24T09:24:01+09:00 Subject: Re: How do you save the contents of an object? ------=_Part_98187_10197050.1161649437405 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Yes, it's called Marshaling. # Create a trivial object a = "Object to save" # Save it to stored_object stored_object = Marshal.dump(a) # Destroy "a" a = nil # Restore the object a = Marshal.load(stored_object) You can read more about it here: http://ruby-doc.org/core/classes/Marshal.html Ruby makes it a breeze to implement. You can also use YAML to save your Marshaled object data via YAML's dump and load methods. See more about that here: http://ruby-doc.org/core/classes/YAML.html Hope this helps! On 10/23/06, Steve Quezadas wrote: > > Is there an easy way to save the contents of an object in ruby? > > This is hard to google, so I am posting it up. I just need a general > idea (if anyoen has it), you don't have to spell it out for me. > > -- > Posted via http://www.ruby-forum.com/. > > -- Robert W. Oliver II President, OCS Solutions, Inc. - Web Hosting and Development http://www.ocssolutions.com/ Toll-Free Phone - 1-800-672-8415 OCS Ruby Forums - http://www.rubyforums.com/ My Blog - http://www.rwoliver.com/ ------=_Part_98187_10197050.1161649437405--