This video is only a short sample, but you can access the full version and all our other great content by subscribing.Subscribe Now
In this episode, Joe and Ben discuss a fairly advanced example of refactoring.
You'll dive into the good, the bad, and the ugly of code before and after being rewritten. The new code uses a number of design patterns, including the Builder pattern, the Chain of Responsibility pattern, the Null Object pattern, and the Decorator pattern. It also combines object-oriented object composition with functional style recursion using inject.
If you'd like to see more examples of this type of refactoring, check out Ruby Science.