Join Kevin Skoglund for an in-depth discussion in this video Load, require, include, part of Ruby: Classes and Modules.
- [Instructor] In this movie,…I want us to spend a few minutes…talking about the difference…between load, require and include in Ruby.…Load is a command that we haven't used in Ruby so far…and it's actually not used very frequently at all.…Load just simply loads a source file every time it's called.…And it returns true if the file is loaded successfully.…False if not.…The reason it's not used very often…is because require is used very frequently.…Require works exactly the same way as load,…except that it loads a source file only one time.…
It keeps track of the fact that it's already loaded the file…so that it doesn't duplicate it and load it again.…It returns true if a file is loaded successfully…and has not been loaded before.…So because require keeps track of the files that we load,…it's used much more often than load.…Now include on the other hand,…which we've just been using…in this chapter is very different.…It includes modules in classes.…That's what it does,…it has nothing to do with loading files.…It's important to understand this difference…
- Defining a custom class
- Working with instances of a class
- Class and instance attributes and methods
- Class inheritance
- Working with dates and times
- Using modules as namespaces and mixins
- Raising and handling exceptions
Skill Level Beginner
2. Class Attributes and Methods
4. Dates and Times
- 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.