Intermediate
Ruby
Q75 / 100
What is the role of "Module#prepend" compared to "include"?
Correct! Well done.
Incorrect.
The correct answer is B) prepend inserts the module before the class in the ancestor chain, so the module's methods can override and call "super" to reach the class's own methods
B
Correct Answer
prepend inserts the module before the class in the ancestor chain, so the module's methods can override and call "super" to reach the class's own methods
Explanation
Unlike include (which places the module after the class in the method lookup chain), prepend places the module before the class, allowing the module to intercept and wrap the class's methods via super.
Progress
75/100