Sohan's Blog

Things I'm Learning

How to Extend a Ruby Module?

Modules in Ruby are like classes with a few important differences. One of the differences is, a module cannot inherit from another module using the same syntax as class inheritance. However, its pretty easy to inherit a module’s method into another module, by just using the include ModuleToInclude syntax. Here’s an example if you are looking for one: