First page Back Continue Last page Overview Text


Remember how I said that defining a class method using self.all makes it unoverriddable by modules?

This is because if you define a class method using self.all, it is defined directly on the class's singleton class, and extending the class with a module inserts the module after the class's singleton class.

Ruby does not provide a way to insert a module before an object's singleton class.

So, given ruby's method lookup process, how do you allow a user to easily override methods that you have defined?