Secret Garden(Instrumental)
id:osyo-manga
Ruby で動的に refine を定義する
Ruby で refinements を利用すると次のようにクラス拡張を特定の範囲でのみ適用させることができます。 module StringEx refine String do def twice self + self end end end using StringEx p "homu".twice # => "homuhomu" 上記の場合は StringEx モジュールを定義してそれを using しているのですが、次のようにして無…