Test Yourself: Object-Oriented Ruby Basics

Making sure you've covered everything you need to know for the coming projects.

Scroll down...

Content

Resources

Comments

Test your knowledge with the questions below. Make sure you can answer them before starting on the assignments. All of the answers are contained in the previous lessons.

Introduction to Object Orientation

  • What is Object Orientation?

Classes

  • What are three signs you should probably use a class?
  • What's the difference between a Hash and a Class?
  • What is an "Instance" of a class?
  • How do you "Instantiate" an instance of a class?
  • How should classes be named?

Instance Variable and Methods

  • What are "Instance Variables"?
  • When and where do you typically assign instance variables to a class?
  • What are "Instance Methods" and how do you call them?
  • What are "Getters and Setters"?
  • How do they relate to the idea of a class interface?
  • Who is allowed to access instance variables?
  • What is the function of attr_accessor?
  • What are its "read-only" and "write-only" relatives?
  • When should you make something like an instance variable visible or editable?
  • Is self required when running class or instance methods or retrieving instance variables?

Class Variable and Methods

  • What are "Class Variables" and how do you denote them?
  • How are class variables different from "Constants"?
  • What are "Class Methods" and how do you denote them?
  • When should you use class methods?
  • What is a "Factory Method" and why might it save you time?
  • How do you access instance variables from a class method?

Storing Classes in Multiple Files

  • How do you break several classes out into multiple files?
  • What is the difference between require and require_relative?


Sign up to track your progress for free

There are ( ) additional resources for this lesson. Check them out!

There are no additional resources for this lesson just yet!

Sorry, comments aren't active just yet!

Next Lesson: Object-Oriented Warmups I