Examine the code in this repository and diagram the Object Model for a Chair
instance.
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:
- "method"
- "class"
- "module"
- "superclass"
- "superclass's module"
- "superclass's superclass"
- 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