From: Robert Klemme Date: 2009-03-08T23:01:53+09:00 Subject: Re: Extending has for default value, can't get it to work 2009/3/7 Jo Be : > http://pastie.org/409974 > > When I instantiate MyHash.new I get an empty hash. Just not sure how to > proceed. If initializing the Hash with particular values is the only reason for a subclass, I would not choose this approach. You could rather do any of these 1. cloning MyHash = {:foo => "bar".freeze}.freeze new_hash = MyHash.dup 2. method def Hash.my {:foo => "bar"} end new_hash = Hash.my IMHO a subclass is only worthwhile if you add functionality. But even then I'd probably rather consider delegation over inheritance. Another alternative is to create a module with additional functionality. It all depends on what you want to achieve. Kind regards robert -- remember.guy do |as, often| as.you_can - without end