If I have the following array:
foo = ['a', 'b', 'c', 'd', 'e']
Is there a simple way in Ruby to make it into a hash that looks like:
{ 'a' => 'a', 'b' => 'b', 'c' => 'c', 'd' => 'd', 'e' => 'e' }
I can do this:
Hash[foo.map{|a| [a, a]}]
which works just fine, but I'm curious if there's some other way.