Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Michael Cook](https://secure.gravatar.com/avatar/8a471b2f3f70f901350409ff083259df?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Michael Cook
5,864 PointsHi! I'm not exactly sure what to do in Ruby Loops section 4, where I have to assign hash values from methods. Thanks!
Just as the title says! I tried some code here and there, but with this one, it just really hits me hard. I don't have much clue on what to do. The code below is the starting code the challenge gives you.
contact_list = []
contact = {"name" => "", "phone_number" => "" }
5 Answers
![Antonio De Rose](https://secure.gravatar.com/avatar/874005afcfec1528616a756435401c28?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Antonio De Rose
20,885 Pointsquestion says, that assume that the function for get_name is already there with no parameters, and asks you to call the get_name function, and the return value, should update the hash name in the contact array
contact_list = []
contact = {"name" => "", "phone_number" => "" }
#I have written the function for you, which you do not have to write,
#just to give you an understanding on what the broader level of question
#in the challenge you should not write this below function, instead how you
#call that function to update the name hash in contact array
def get_name()
print "what is your name ? "
return gets.chomp
end
![Michael Cook](https://secure.gravatar.com/avatar/8a471b2f3f70f901350409ff083259df?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Michael Cook
5,864 PointsThanks, that helped a little, but I'm not sure how to exactly have get_name edit the hash at all.
![Michael Cook](https://secure.gravatar.com/avatar/8a471b2f3f70f901350409ff083259df?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Michael Cook
5,864 PointsLooking at the videos and watching them again, I'm not sure how to get get_name to edit the hash without editing get_name itself, sorry if I'm missing something important.
![Michael Cook](https://secure.gravatar.com/avatar/8a471b2f3f70f901350409ff083259df?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Michael Cook
5,864 PointsAlright, well I figured it out on my own, but thanks for your help! I appreciate it!
![Alexander Fritsch](https://secure.gravatar.com/avatar/c2656aa344d11a786e09f7ae5c800bc5?s=60&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Alexander Fritsch
3,184 PointsDude...
Others have befallen your turmoil.
What was the fix?
![Alexander Fritsch](https://secure.gravatar.com/avatar/c2656aa344d11a786e09f7ae5c800bc5?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Alexander Fritsch
3,184 PointsOk I too figured it out...
Don't listen to Antonio De Rose's answer as it implies you must pass a string to the get_name method.
The answer is you're overthinking it... Just call the method IN the hash.