Beginner Question = How do I access a Symbol in an Array

#1

Sorry for such an elementary question, but having no luck finding it on any search engines. . .

I have created an array of symbols. . .
family_data = [:id, :name, :brush_color, :primary_insured_id, :contract_effective_date]
I have successfully loaded the array from a file. . .
family_file.each
.with_index do |line, i|
fields = line.split(",")
family_data.push(id: fields[0], name: fields[1].downcase.capitalize, brush_color: fields[2].downcase, primary_insured_id: fields[3], contract_effective_date: fields[4].chomp)

I can see the entire array. . .
puts(“family_data: " + family_data[-1].to_s)
family_data: {:id=>“6”, :name=>“Ben”, :brush_color=>“green”, :primary_insured_id=>“3”, :contract_effective_date=>”"}

Can not figure out how to access onesymbol an array entry?. . .
puts("family_data[-1].:name: " + family_data[-1].:name)

I have tried many variations. Any suggestions would be greatly appreciated.

Thanks,
George

#2

All,

Thanks for reading this. . .I found the syntax (by trial and error, still have not found anything in the search engines). . .This works for me. . .

puts("family_data[-1].:name: " + family_data[-1][:name])

Thanks,
George