From: Rick DeNatale Date: 2007-03-31T08:30:44+09:00 Subject: Re: Is there a library/mechanism for an object/hash hybrid? On 3/30/07, dtrusty@my-deja.com wrote: > Hi, > > There are times when I want to store items in a hash, and yet refer > the items > using class/object method syntax. > > For example, I may want to do this: > myhash['aaa'] = 'bbb' > and then be able to refer to the 'aaa' element either as > myhash['aaa'] > --or-- > myhash.aaa > > I started writing my own class to do this, but I wanted to check to > see if anyone had > already done so. I just read about this in a blog yesterday: http://www.oreillynet.com/ruby/blog/2007/03/camping_hashwithreallyindiffer.html The camping framework has a HashWithIndifferentAccess which does this. Not to be confused with the class HashWithIndifferentAccess in Rails (actually in ActiveSupport) -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/ IPMS/USA Region 12 Coordinator http://ipmsr12.denhaven2.com/ Visit the Project Mercury Wiki Site http://www.mercuryspacecraft.com/