October 2006
Intermediate to advanced
888 pages
16h 55m
English
Frequently we want to store and retrieve data in a more transparent manner. The Marshal module offers simple object persistence, and the PStore library builds on that functionality. Finally, the dbm library is used like a hash stored permanently on disk. It does not truly belong in this section, but it is too simple to put in the database section.
In many cases we want to create an object and simply save it for use later. Ruby provides rudimentary support for such object persistence or marshaling. The Marshal module enables programs to serialize and unserialize Ruby objects in this way.
# array of elements [composer, work, minutes] works = [["Leonard Bernstein","Overture to ...
Read now
Unlock full access