Intermediate
Ruby
Q45 / 100
What is the difference between "extend" and "include" with modules?
Correct! Well done.
Incorrect.
The correct answer is B) include adds module methods as instance methods, while extend adds them as methods of the specific object or as class methods when used at the class level
B
Correct Answer
include adds module methods as instance methods, while extend adds them as methods of the specific object or as class methods when used at the class level
Explanation
include mixes module methods in as instance methods of the including class; extend adds module methods directly to the singleton class of an object (or class, making them class methods).
Progress
45/100