Join Kevin Skoglund for an in-depth discussion in this video Challenge: Radio, part of Ruby Essential Training: 2 Classes and Modules.
- [Narrator] It's time for another Challenge assignment.…In this challenge, you're going to build a radio in Ruby.…Now, of course, that's not a real radio,…it's not going to actually play any music…but we're going to be defining a radio class…that will act like a radio.…It will have controls for the volume,…for the radio frequency and the band…meaning AM or FM.…The first step is to get the basics of your radio working.…That is to have the volume,…be able to set it and to read it…and to able to get a status showing what the volume is.…You may remember that we saw this in the last chapter…in the movie on Attribute Methods.…
Let me remind you of what that looked like.…So, you have something like this…that has an attribute reader for volume,…you have the ability to set those…and you get back a status.…You can either copy this code down…or it's included in the exercise files…but it's also a good chance…for you to try to write it from scratch;…to refresh your memory and solidify those skills.…Once you've got there,…now it's time for the new work.…
- 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.