Join Kevin Skoglund for an in-depth discussion in this video Adding restaurants, part of Ruby Essential Training.
Now that we are handling the user input well, we need to start responding to…that input with some meaningful results.…The actions inside our food finder.…And I am going to start out with the add restaurant action, because we can't…really list or find restaurants until we have some.…So, here we are going to concentrate on getting the information about the…restaurant, and then saving it to that restaurant's text file.…Inside the guide.rb file we have been working with, we already have a do_action,…that takes a string, and if that string is equal to add, then it's going to do…our add action, right.…Well, we could put all the code for that right here inside the case statement,…but I think it's better to use this as sort of a signpost, telling us what…method we are to call from here, and then we'll have one called add.…
And then I'll make a new method down here, just call it add, and so when it's…equal to add, we'll call the method add.…So, all of this will get executed.…So, what do we want to do?…
- Using Ruby in the Interactive Ruby Shell and in standalone scripts
- Learning to write custom code blocks to find, merge, and sort
- Using modules for namespacing or as mix-ins
- Reading from and writing to files
- Creating a full Ruby project from start to finish
Skill Level Beginner
1. Getting Started with Ruby
2. Ruby Object Types
3. Control Structures
4. Code Blocks
8. Working with Files
9. Ruby Project: Creating the Food Finder
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.