Hi Ruby friends:

conversion fr hash to array is fine.

>> h
=> {"x"=>1, "y"=>3}
>> a = h.to_a
=> [["x", 1], ["y", 3]]

no brainer there for a nuby like me :-)

but...

conversion fr array to hash... is quite a journey...

>> h2 = a.to_h
NoMethodError: undefined method `to_h' for [["x", 1], ["y", 3]]:Array

>> h2 = a.to_hash
NoMethodError: undefined method `to_hash' for [["x", 1], ["y", 3]]:Array

Finally, I got it (dug the archives)..

>> h2 = Hash[*a]
=> {["x", 1]=>["y", 3]}

But, it looks weird. No, not just the cryptic Hash*a, but the result as
well. I do not see any use of the result.

I would rather prefer:

>> h2 = a.to_hash   # or a.to_h
{"x"=>1, "y"=>3}

Seems no brainer if that's the case.
Is there any reason why not?

kind regards -botp