From: Mario Ruiz Date: 2011-10-12T02:07:43+09:00 Subject: array of hashes I have an array of hashes like this: a=Array.new() a.push({:name=>"mario",:value=>"xxx"}) a.push({:name=>"pedro",:value=>"lsss"}) and I would like to get a value of the array knowing the :name by doing something like: a.each {|h| if h[:name]=="mario" then value=h[:value] } but just in one line, is that possible? -- Posted via http://www.ruby-forum.com/.