[5, 6, 7]
の各要素をtorow
の値にどのように割り当てて、にrow
なるようにし{1=>5, 2=>6, 3=>7}
ますか?
row = {1=>0, 2=>1, 3=>0}
#this following line doesn't work of course
row.values = [5, 6, 7]
#NoMethodError: undefined method `values=' for {1=>0, 2=>1, 3=>0}:Hash
row
#I want: {1=>5, 2=>6, 3=>7}