Advanced
Ruby
Q89 / 100
What is the difference between "BasicObject" and "Object" as a superclass for a custom class?
Correct! Well done.
Incorrect.
The correct answer is B) BasicObject has almost no methods defined (not even inspect or to_s), making it a blank-slate base for proxy or DSL classes where method_missing should intercept nearly everything, whereas Object includes Kernel methods
B
Correct Answer
BasicObject has almost no methods defined (not even inspect or to_s), making it a blank-slate base for proxy or DSL classes where method_missing should intercept nearly everything, whereas Object includes Kernel methods
Explanation
BasicObject is intentionally minimal, lacking the Kernel module methods that Object provides, making it ideal for building proxy objects that rely heavily on method_missing without naming collisions.
Progress
89/100