From: Aldric Giacomoni Date: 2010-04-16T22:04:07+09:00 Subject: Re: Writing a parser Martin Hansen wrote: > Ah, yes, that is how a hash works :). Now I am interested in getting my > add method to work because it does some consistency checking on the key > and value. However, my add method is defined the wrong way/place. class Hash def add # your code here end end But monkey-patching can be a Bad Thing(tm) so be careful. I would recommend doing your checks in your code, or maybe in a separate function. Or, you could even create a real Record object instead of just a hash! class Record < Hash # studd end -- Posted via http://www.ruby-forum.com/.