What we did in the last exercise might not have seemed strange to you, but think about it: we mixed together the behaviors of a class and a module!
When a module is used to mix additional behavior and information into a class, it’s called a mixin. Mixins allow us to customize a class without having to rewrite code!
Check out the code in the editor. See how we define the
jump method in the
Action module, then mix it into the
Cricket classes? Click Run to see the effect!