On 7/16/07, James Edward Gray II <james / grayproductions.net> wrote:
> On Jul 16, 2007, at 5:58 AM, hemant wrote:
>
> > a.inject({}) {|mem,(key,value)| mem[key] = {'name' => value}; mem }
>
> I would write that as:
>
>    a.inject(Hash.new) { |h, (k, v)| h.merge(k => v) }
>
> James Edward Gray II
>
>

But that doesn't yield what he wanted... You could do
a.inject(Hash.new){|h,(k,v)| h.merge(k => { 'name' => value})}

-- 
Chris Carter
concentrationstudios.com
brynmawrcs.com