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/.