注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています
Defining Methods Dynamically You have methods that can be defined more concisely if defined dynam... Defining Methods Dynamically You have methods that can be defined more concisely if defined dynamically. def failure self.state = :failure end def error self.state = :error end becomes def_each :failure, :error do |method_name| self.state = method_name end Motivation I use Dynamically Define Method quite frequently. Of course, I default to defining methods explicitly, but at the point when duplica
2014/09/26 リンク