How to conevert an array to hashes

hi,

i would like to know about if any method available in ruby to convert
the array into a hash in ruby

with regards,
anoob bava

a=[[‘1’,2],[‘2’,5]]

puts a.to_h

output

{“1”=>2, “2”=>5}

Hash[1,2,3,4]
=> {1=>2, 3=>4}

a= [1,2,3,4]
Hash(*a)
=> {1=>2, 3=>4}