Join Kevin Skoglund for an in-depth discussion in this video Improving output, part of Ruby Essential Training.
In the last movie, we were able to read the restaurants back from the text file…and output them for our user to see, but the output is not that pretty.…In this movie, I want us to explore couple of techniques we can use to make that…output a lot better.…The first thing you'll notice is that I've added a couple of files in.…So these are going to be in the exercise files or I'm going to show them to you…and you can copy them down.…But I've created a new folder called support, and in there is number_helper.rb…and string_extend.rb, and we're going to be using both of those.…I've called it support, because these are just kind of the support files that…will help me with my library.…
It doesn't matter really how you organize them.…So let's open up number_helper.…This is a module that we can use as a mix-in into our classes and it…borrows heavily on a method that's inside the Ruby on Rails framework,…called number_to_currency.…So that's what I've called it again.…It's number_to_currency.…We provide a number, and then a set of options, and those options can be the…
- 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?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
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.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.