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. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
On 23 Oct 2006, at 05:03, Steve Quezadas 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 Robinson http://vagueware.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Or, if you want a human-readable (text) format, try YAML (require ''yaml''). best wishes Huw Collingbourne http://www.sapphiresteel.com Ruby Programming In Visual Studio 2005 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Steve Quezadas 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 Paul gustav-PUm+PnBUKx7YkQIYctQFYw@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---