Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Build an Address Book in Ruby!
You have completed Build an Address Book in Ruby!
Preview
In this video, we implement searching on the user facing side of things.
Code Samples
when 's'
print "Search term: "
search = gets.chomp
find_by_name(search)
find_by_phone_number(search)
find_by_address(search)
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
So, first we'll add that as a prompt
on the menu, we'll say Search.
0:00
And this is going to be pretty easy.
0:06
We just add another menu
option in our case statement.
0:09
So when it is the letter s.
0:13
We'll just say enter your search term.
0:18
And then we will grab
that from standard input.
0:24
And now, we've got all of the different
methods that we wrote earlier,
0:28
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up