Join Kevin Skoglund for an in-depth discussion in this video Class attributes, part of Ruby Essential Training.
So far we've seen how we can create methods on our instances, and those are…called instance methods.…We've seen how we can create methods on our classes, and those are called class methods.…We also saw how we could put attributes on our instances.…It would store values that were particular to the instance.…In this movie, we are going to take a look at class attributes, which are the…same thing, but attached to our classes.…That is, they are for storing values that apply to the class generally.…The same way that the class methods apply to the class generally.…
And the way that we'll store these values is going to be in a class variable.…We took a peek at this before, when we were looking at instance variables.…It's in the line right above it with two @ signs in front it.…So, if you see the two @ signs, it's a class variable and it will persist…anytime we have the class, even if we don't have an instance.…Instance variables are going to be only inside of the instance.…That's the only time we'll have those.…
- 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
Q: You mention e-texteditor.com as a place to get a Windows "sister" version of TextMate. However, e-texteditor.com looks like a Chinese auto website. Are there any other alternatives?
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.