Assuming what you mean by "rowofrows", this is an array of arrays, this is the solution that I think you are trying to execute:
array_of_arrays = [["abc",9898989898," abc@xyz.com "], ["def",9898989898," def@xyz.com "]] array_of_hashes = [] array_of_arrays.each { |record| array_of_hashes << {'name' => record[0], 'number' => record[1].to_i, 'email' => record[2]} } p array_of_hashes
Print an array of hashes:
[{"name"=>"abc", "number"=>9898989898, "email"=>" abc@xyz.com "}, {"name"=>"def", "number"=>9898989898, "email"=>" def@xyz.com "}]
source share