Hacker News new | ask | show | jobs
by joevandyk 4359 days ago
You can only inherit from one class in ruby. You can mixin multiple modules into a class. So they aren't entirely equivalent.
1 comments

Under the hood, mixing in modules actually is inheritance. An anonymous class is created that has all the module's methods, and this class is added to the inheritance hierarchy.

They are quite literally identical, even if Ruby tries it's best to hide that fact.