Here is a hash
personal_details = {
name: name,
dob: dob,
age: age,
height: height
}
Here is an array
puts "What are the name of some of your relatives? (eg. Bob, James, Harry etc)"
relatives = gets().chomp.split(",")
Lets say the input for relatives was "Bob, James, Harry".
I want the hash to look like this:
personal_details = {
name: name,
dob: dob,
age: age,
height: height
relatives: [
{name: Bob},
{name: James},
{name: Harry}
]
}
The array in the hash is updated based on user input.