From: Artur Merke Date: 2005-02-22T01:34:45+09:00 Subject: Re: YAML and hash On Mon, 21 Feb 2005, Robert Klemme wrote: > > 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 I have looked into this and yaml/rubytypes.rb but still don't have any idea how to implement this kind of behavior. are the some YAML experts out there, which can provide an example for this? -- Artur