From: Adam Lauper Date: 2009-12-19T03:56:29+09:00 Subject: How to reopen the puts method I am looking for some additional detail regarding the puts method. Hows does the basic puts method work? module Kernel def self.puts text $stdout.puts "New_Text" end end # the following code doesn't actually call the Kernel puts method I've redefined. puts "Hello, World!" # however, this code does. Kernel.puts "Hello, World!" I would like to insert a debug flag into the basic puts method and suppress the output unless a flag is true. Something like this... (except this doesn't work) module Kernel def self.puts text, debug=false $stdout.puts text if debug end end puts "Hello, World!", true Any ideas? -- Posted via http://www.ruby-forum.com/.