概要 原著者の許諾を得て翻訳・公開いたします。 英語記事: Why Ruby Class Methods Resist Refactoring 原文公開日: 2012/11/14 著者: Bryan Helmkamp サイト: https://codeclimate.com/ 2018/01/30: 初版公開 2023/01/19: 細部を更新 肥大化したActiveRecordモデルをリファクタリングする7つの方法(翻訳) 私の記事『肥大化したActiveRecordモデルをリファクタリングする7つの方法』に対して、「クラスメソッドでできることをなぜわざわざインスタンスでやるんですか?」という質問をよくいただきました。お答えしましょう。要するに以下が理由です。 私がクラスメソッドよりオブジェクトインスタンスを好む理由は、クラスメソッドはリファクタリングに抵抗するからです。 詳しく説明する