Class, superclass, metaclass, singleton class, eigenclass, class <<self, class Class, Class.new. We all know that Ruby is an object oriented language, and specifically it is a class based language. One of the strengths of Ruby is that it can be extremely usable without having to really understand what’s going on behind the scenes. Drift from the happy path, however, and you can find yourself wandering in a dream-world of class<<self or trying to grok the difference between ‘include’ and ‘extend’. This talk will try to explain why we have classes and metaclasses, and how it all hangs together (and a bit about the movie Inception, to keep things from getting too boring.)
- Date: 2012-05-19
- Location: Chicago Software Craftsmanship
- On the Inception of the Ruby Object System (pdf of slides, 6.1mb)
- Justin Love’s ruby metaclass bookmarks on Pinboard
- Ruby object, class, and metaclass examples and experiments.