2012-07-05から1日間の記事一覧
ruby -d で実行して $DEBUG が真になった時にだけブロックを実行するメソッド、的なものはあるんでしたっけ? if $DEBUG def debug yield if block_given? end else def debug end end debug { puts 'x' } こんな感じのやつ。※ ついでに、こういうやつにふさ…
ruby -d で実行して $DEBUG が真になった時にだけブロックを実行するメソッド、的なものはあるんでしたっけ? if $DEBUG def debug yield if block_given? end else def debug end end debug { puts 'x' } こんな感じのやつ。※ ついでに、こういうやつにふさ…