--90e6ba4fc4c669e10a049b4e9489
Content-Type: text/plain; charset=ISO-8859-1

2011/2/2 Andrew Wagner <wagner.andrew / gmail.com>

> Here's one simple way to do it:
>
> hash  rray.inject({}) do |result, array|
>   key,val  rray
>  if result[key].nil?
>    result[key]  val]
>  else
>    result[key].push val
>  end
>  result
> end
>

Thanks Adam. I just reduced your lines to make it geeky!! :-)

hash  rray.inject({}) do |result, (key, value)|
  (result[key].nil?) ? (result[key]  value]) : (result[key].push(value))
  result
end

---
Edmond
Software Developer | Baobab Health Trust (http://www.baobabhealth.org/) |
Malawi

Cell:  +265 999 465 137 | +265 881 234 717*
**
An old dog does not hunt because of speed, but his endurance of the heart*

--90e6ba4fc4c669e10a049b4e9489--