Is there a way to save an object to disk?

I am new to ruby so pardon my naive question, but:

Is there an easy way to save the contents of an object to disk? Is there
an easy way to read it back?

You don’t have to spell it out for me, I just need the general idea of
how to do it.

On 23 Oct 2006, at 05:03, Steve Q. wrote:

Is there an easy way to save the contents of an object to disk? Is
there
an easy way to read it back?

You don’t have to spell it out for me, I just need the general idea of
how to do it.

Start here:

http://www.ruby-doc.org/core/classes/Marshal.html

See? Got the juices flowing? HTH,


Paul R.
http://vagueware.com

Or, if you want a human-readable (text) format, try YAML (require
‘yaml’).

best wishes
Huw C.

http://www.sapphiresteel.com
Ruby P.ming In Visual Studio 2005

Steve Q. wrote:

I am new to ruby so pardon my naive question, but:

Is there an easy way to save the contents of an object to disk? Is there
an easy way to read it back?

You don’t have to spell it out for me, I just need the general idea of
how to do it.

Your question inspired me to a blog post on the subject…

Check it out here:
http://rails.co.za/articles/2006/10/23/saving-ruby-objects-to-disc

Cheery-o
Gustav P.
[email protected]