From: Trans Date: 2007-07-27T04:18:44+09:00 Subject: Re: Modeling -- how to support multiple views of same components? On Jul 26, 10:55 am, Robert Klemme wrote: > Can you disclose more detail? Sure. It's for configuration information. On the one hand, I want to be able to read package settings from a file that is strictly dedicated to packaging. So, for instance my project might have a .package file that has basically: project: foo version: 1.1 dependencies: [ facets ] formats: [zip, tgz, gem] However, I also want to support an uber-project configuration file, that would look like: project: foo version: 1.1 package: dependencies: [ facets ] formats: [zip, tgz, gem] So I have two slightly different formats that I want to support with strict classes. Eg. in the first case: pkg = Package.load(file) pkg.project #=> 'foo' pkg.formats #=> ['zip','tgz','gem'] and in the other: pkg = Project.load(file) pkg.project #=> 'foo' pkg.package.formats #=> ['zip','tgz','gem'] So, the same info, but organized in the two different manners, as I described in the original post. Note, by "strict class" I mean I'm not just keying off a YAML-loaded hash. I need a class b/c various attributes have default values, validation and formating applied, plus supporting methods. T.