From: David Vallner Date: 2006-02-09T23:08:22+09:00 Subject: Re: yaml object de-serialisation Dňa Štvrtok 09 Február 2006 14:38 Une bévue napísal: > > now the third case i've an old way to save prefs into a yaml file, > basically a hash instead of an instance of Preferences > > in that case i only have to add another method to the Preferences class, > saying : > > prefs=Preferences.new > prefs.updateFromOlderFileStructure > > prefs.save > > again, that's all. > > am i right ? Ah, this third case wasn't quite obvious from your example. But yes, you're stuck to adapting the old preference structure to the new more or less by hand. This doesn't seem like a particularly error prone piece of code, so I'd stick with whatever seems to work for now, direct or indirect. As long as it works... You could possibly golf down your script by having the new Theme object take as constructor parameters the whole old corresponding object, but I don't quite like this sort of coupling of compatibility code in the main logic. David Vallner