From: Joel VanderWerf Date: 2008-08-24T07:22:01+09:00 Subject: Re: YAML::load help Jayson Williams wrote: > The difference between the original hash and the hash loaded from the > .yml file is that the original data shows the hash key, with a struct > as the hash value: > > Key#attrib='data', attrib='data'> > > The data after the yml load looks like: > > Key and thats it. > > The .yml file shows that there is a !ruby/struct, but after the load, > I am not seeing it. I also tried File.read with the same results. > > ~Jay Looks ok as far as I can reconstruct what you're doing (using ruby-1.8.6-p287): require 'yaml' Foo = Struct.new :x, :y h = {"key" => Foo.new(1,2)} s = YAML.dump(h) puts s h2 = YAML.load(s) p h p h2 __END__ Output: --- key: !ruby/struct:Foo x: 1 y: 2 {"key"=>#} {"key"=>#} -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407