array_of_hashes = [{:first => 1, :second => 2}, {:first => 10, :third => 3}]
Hash[*array_of_hashes.collect{|hash| hash.collect{|key,value|
[key,value].flatten}.flatten}.flatten]
=> {:first=>10, :second=>2, :third=>3}
On Thu, Dec 9, 2010 at 10:26 AM, Priya Buvan <[email protected]> wrote:
> @Michael: yes its in array..
>
> @Marnen: If there is more than one key with same name, obviously it'll
> be override. This is fine.
>
> Anyway i'm trying to fetch the result separately. I'll reply with latest
> updated soon.
>
> Thanks,
> Buvana
>
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.