Join Kevin Skoglund for an in-depth discussion in this video Challenge: Secure radio, part of Ruby Essential Training: 2 Classes and Modules.
(digital music tones)…- [Instructor] It's time for another challenge assignment.…In this challenge, we're going to build a secure radio.…In order to build our secure radio, we're going to start…by working with that class that we created in the last…challenge, which was radio.…And the idea is going to be that radio play is going…to return a placeholder for an audio stream.…Now it's not actually going to return actual audio,…but we're going to simulate that by having some text…output to the command line.…Then we're going to define the secure radio class and…have it inherit from radio.…
A secure radio works just like a regular radio,…except when we call play, it returns an encrypted…audio stream.…Now in the exercise files, I've already given you the…starter part of this.…In the radio class, I've gone ahead and added a class…variable for audio samples, and it equals an array with…a bunch of different text strings that describe different…songs or things that might be playing on the radio.…So we're going to output that when we call play.…
- 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.