2011-05-10から1日間の記事一覧
モンキーパッチを適用するときは、必ずモジュールを書いてからそれをincludeさせるようにする class String def /(that) "#{self}/#{that}" end end こういうコードを書くのはイケてないという考え方。 module StringExtension def /(that) "#{self}/#{that}…
モンキーパッチを適用するときは、必ずモジュールを書いてからそれをincludeさせるようにする class String def /(that) "#{self}/#{that}" end end こういうコードを書くのはイケてないという考え方。 module StringExtension def /(that) "#{self}/#{that}…