Jayson Williams
8/23/2008 10:46:00 PM
On Sat, Aug 23, 2008 at 6:22 PM, Joel VanderWerf
<vjoel@path.berkeley.edu> wrote:
> Foo = Struct.new :x, :y
>
> h = {"key" => Foo.new(1,2)}
>
> s = YAML.dump(h)
> vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407
>
Thanks Joel,
That helped. The problem a result of how I was adding the Struct value
to the hash. I was trying to condence everything into one line like
this
s={'key'=>Struct.new(:x,:y).new(1,2)}
Looks like YAML could not recognize this as a struct for some reason.
Doing the same thing in the more traditional two steps, solved the
problem.
Thanks all.