Skip to content

turingschool-examples/lookup_chain_exercise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ruby Lookup Chain Exercise

Activity 1

Examine the code in this repository and diagram the Object Model for a Chair instance.

Activity 2

The Chair class has several superclasses and modules where Ruby can look for methods. At the bottom of the chair.rb file, a new instance of chair is created and the chair_type method is called on that instance. Your job is to comment out sections of the code in order to get chair_type to print each of the following:

  1. "method"
  2. "class"
  3. "module"
  4. "superclass"
  5. "superclass's module"
  6. "superclass's superclass"

Wrap Up

  • How does Ruby’s look up chain work? What is the order it checks things?
  • What are three methods you can use to learn about where a built in Ruby method gets its components?
  • Draw a diagram of where Ruby would look for the method ::new

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages