From: Larry Fast Date: 2007-08-26T09:06:24+09:00 Subject: class X < Hash ... how do I do X.new { |hash, key| ...} ? I created a child class of Hash and would like to internalize the equivalent of Hash.new {|hash,key| } The following code failed: class X < Hash def initialize super { |hash,key| ... } end end Any suggestions? I suppose I could do it externally with a create() wrapper but it doesn't seem very pragmatic. def create_X y = X.new {|hash,key| ... } return y end My overall goal is to record a list of attempts to read undefined Keys. Thanks, Larry -- Posted via http://www.ruby-forum.com/.