Join Kevin Skoglund for an in-depth discussion in this video Load, require, and include, part of Ruby Essential Training.
- View Offline
- Exercise Files
In the last movie, where we were looking at modules as mix-ins, we defined our…module and the classes all in the same file, and we just made sure that the…module came before the class, so that Ruby would have a definition for the…module, so that it could include it when the class definition came up.…Well, more typically, we would not put those in the same file.…We would break them into separate files, and our modules would start to exist…in their own files, like code libraries, that we could just mix-in that library…whenever we needed.…So frequently you will end up with these small little module files that you can…draw upon whenever you need.…
Well, if we break it off into a separate file, what that means is that we have…to have a way of making sure that Ruby has loaded in that module and knows…that definition before we try and mix it in to one of our classes, like our…Person class, and that gives us the perfect opportunity to take a look at…three Ruby commands:…Load, Require, and Include.…
- 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.