From: Joel VanderWerf Date: 2009-06-06T03:42:27+09:00 Subject: Re: Building custom objects from YAML James French wrote: > Hi, > > If I start by a human-written block of data, such as ITEMS below, is it possible to deserialize these into objects of type Item? How might this be done? Easy, just yaml them to find out how the serialized form should look: class Item attr_accessor :name attr_accessor :type attr_accessor :location def initialize @name = "" @type = "" @location = "" end end require 'yaml' y Item.new If you run this you get: --- !ruby/object:Item location: "" name: "" type: "" Then you can play with the string and check that YAML.load does the right thing on this data -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407