From: Brian Candler Date: 2009-03-24T00:42:20+09:00 Subject: Re: Newbie needs help with first project Daniel Dale wrote: > Thanks for all the help. I appreciate it. just had a thought though. > continuing the way I'm doing it now all the games I enter will be lost > when I close the program right ? Yep. In addition to the options already listed: - Marshal.dump and Marshal.load will store an arbitrary graph of Ruby objects (that is, the object plus all the objects it refers to) to an opaque binary file. Some objects cannot be Marshaled - e.g. File/IO objects, procs, and any object with singleton methods - There are plenty of libraries which will store your objects in a SQL database, the most popular being ActiveRecord, but there are many other options including Sequel and DataMapper. In this case, you need not define attributes in your class at all, because they are added at runtime based on the columns in the database. That is, ActiveRecord::Base.establish_connection( ... database connection params ... ) class Game < ActiveRecord::Base; end is all you need to access a table called 'games'. Of course, sorting and searching are bread-and-butter to a SQL database. HTH, Brian. -- Posted via http://www.ruby-forum.com/.