2009-10-25 18 views

risposta

16

Ecco come lo farei:

Hash[*array] 
+0

Wow che è grande, non ho mai saputo di che sintassi prima! –

1
Hash[*[:one, 1, :two, 2]] 
#=> {:one => 1, :two => 2} 
Problemi correlati