From: "Iñaki Baz Castillo" Date: 2011-04-17T01:55:16+09:00 Subject: Re: Get the real object in a Hash key 2011/4/16 Robert Klemme : >> I've coded a parser for SIP (similar to HTTP). The parser generates a >> Request object which inherits from Hash, > > Usually it's better to use composition instead of inheritance to achieve > this.  Now your SipRequest inherits *all* methods from Hash including some > that you might not want users to be able to invoke. Thanks to both. However the SIP parser is already done. I've coded it at C level as a Ruby extension (similar to Mongrel HTTP parser which returns a Hash instance). I can change it for generating a Hash object rather than a custom SipRequest object, and then behave as both of you suggest: class SipRequest def initialize(headers={}) @headers = headers end end I will consider it and also the suggested methods to handle header names and values. Thanks a lot. -- Iñaki Baz Castillo