Ruby modules: Include vs Prepend vs Extend

Léonard Hetsch
5 min readJun 17, 2017

Modules are one of the most interesting features of Ruby. You can use them to attach specific behavior on your classes, and to organize your code using composition rather than inheritance. Here is a simple example:

Also, a lot of gems make use of modules to organize their code and ease up…

--

--

Léonard Hetsch

Software engineer based in London / Technical coach @makersacademy / Previously @stuart @dicefm & @oncetheapp / Studied @gobelins_paris / Hungry learner.