From: Robert Klemme Date: 2005-02-21T23:54:47+09:00 Subject: Re: YAML and hash "Artur Merke" schrieb im Newsbeitrag news:Pine.LNX.4.33.0502211443370.17818-100000@as0203.cs.uni-dortmund.de... > Hi, > > is there a possibility to recognize multiple keys while > reading a hash using YAML? > > example: > > arr= YAML::load("aaa: 1\nbbb: 2\naaa: 3" ) > => {"aaa"=>3, "bbb"=>2} > > but I would like to get a warning or an exception when > encountering the key 'aaa' for the second time, and not just > get the first entry overwritten. > > Any ideas? I don't have much insight into YAML internals but you'll probably be able to do that with YAML#add_builtin_type or YAML#add_ruby_type http://www.ruby-doc.org/core/classes/YAML.html#M001712 Kind regards robert