From: Michal 'hramrach' Suchanek Date: 2002-05-29T01:42:04+09:00 Subject: serialization - how does it really work? Following the pickaxe book I wrote a class and implemented class method _dump. I serialize a subclass of this to a pstore. But the serialization I get is the default one (@@@DUMP gets never printed). What I am missing? Is there some place to look for more details? class StoreRec < StrHash - include ProcRec | extend ProcRec | def StoreRec._dump(lvl) |- p '@@@ DUMP' || ld=@@lasttime._dump(lvl) || td=@@tcache._dump(lvl) || dd=@@dcache._dump(lvl) || sd=super || "#{ld.length}|#{td.length}|#{dd.length}|#{sd.length}|"<< ||-- ld<< td<< dd<< sd | end | def _load(str) |- p '@@@ LOAD' || ll,tl,dl,sl=(1..4).collect{ ||-- str.slice!(0..str.index('|')).chomp('|').to_i}; || @@lasttime=Marshal::load(str.slice!(0...ll)); || @@tcache=Marshal::load(str.slice!(0...tl)); || @@dcache=Marshal::load(str.slice!(0...dl)); || raise unless str.length==sl || super | end end