TJ Singleton

Software Engineer, Baptist Preacher

Why Ruby Class Methods Resist Refactoring

This is a well written post that looks a why choosing to use a class method may not make sense. It’s coincidental that this morning I read this. Last night I was rewriting a job. After my tests were green and I was ready to refactor I noticed that I could simply inline the method into the class perform. I refrained, perfering the simple class instead.

I thought also about the 24th RubyTapas on incidental change. If you start out with a class method and decide to refactor to an object, then there is more change involved than refactoring an existing instance method.

Why Ruby Class Methods Resist Refactoring