RubyFlow The Ruby and Rails community linklog


The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

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

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in