Skip to Content
Object-Oriented Programming II
Extend Your Knowledge

Whereas include mixes a module’s methods in at the instance level (allowing instances of a particular class to use the methods), the extend keyword mixes a module’s methods at the class level. This means that class itself can use the methods, as opposed to instances of the class.


Check out the code in the editor. We’ve extended TheHereAnd with ThePresent, allowing it to use the now method. Click Run to see the effect!

Folder Icon

Take this course for free

Already have an account?