The Template Method Pattern in Ruby (video)
The Template Method pattern allows you to extract the parts of your code that stay the same into a base class and the ones that change into subclasses.
This structure allows you to provide different variations of an algorithm by simply adding new subclasses, and never having to touch the base class, or the existing subclasses.
Post a comment