From: Josh Cheek Date: 2010-12-06T20:41:14+09:00 Subject: Re: Traverse YAML node tree with non-unique values --0016363101bb716f750496bc5dda Content-Type: text/plain; charset=ISO-8859-1 On Mon, Dec 6, 2010 at 5:36 AM, Josh Cheek wrote: > > data = { > :purchase_order => { > :date => '10/12/2010' , > :vendor => 12345, > :items => [{ > :product => 'Tomatoes', > :quantity => 5, > },{ > :product => 'Eggs', > :quantity => 2, > }] > } > } > > Actually, the keys should be strings: data = { 'purchase_order' => { 'date' => '10/12/2010' , 'vendor' => 12345, 'items' => [{ 'product' => 'Tomatoes', 'quantity' => 5, },{ 'product' => 'Eggs', 'quantity' => 2, }] } } require 'yaml' result = YAML.dump(data) puts result puts require 'pp' pp YAML.load(result) --0016363101bb716f750496bc5dda--