From: Douglas Seifert Date: 2009-09-23T10:53:45+09:00 Subject: Re: Array of hashes issue --000e0cd25dd4177dfb047434e9a9 Content-Type: text/plain; charset=ISO-8859-1 > > > Wish there was an easier way to get a value out of a hash by key. > Someone on the board might know. > > > Getting values out of a hash by key is easy. I think the issue you were having is you were unclear exactly what the key was and maybe were confused about the difference between a Symbol and String in Ruby. A Symbol is kind of like an interned String (to borrow some Java speak). They are separate classes and both may be used as hash keys. So this works: h = {} h[:key] = 'my key is a Symbol' h['key'] = 'my key is a String' p h[:key] "my key is a Symbol" p h['key'] "my key is a String" Getting a value out of the hash is as simple as it is in PHP -- just use the [] method. -Doug Seifert --000e0cd25dd4177dfb047434e9a9--