From: Joel VanderWerf Date: 2005-03-07T06:44:59+09:00 Subject: Re: YAML to objects - how? Bill Guindon wrote: > I'm trying to read in a YAML file that has a list of database specs > (name, fields, indexes, etc.) Once that's read in, I'd like to turn > them into an array of db objects. In the end, I want to loop through > the array and generate some code based on each database spec. Is the YAML file something like this? --- - name: Foo fields: - :x - :y - :z indexes: - name: Bar fields: - :a - :b - :c indexes: If so, then you can just YAML.load() the file, and you'll get an array of hashes, which you can iterate over.