Module: Main::Logger::OnOff

Defined in:
lib/main/logger.rb

Instance Method Summary collapse

Instance Method Details

#turn(which) ⇒ Object



41
42
43
# File 'lib/main/logger.rb', line 41

def turn which
  @turned = which.to_s =~ %r/on/i ? :on : :off
end

#write(message) ⇒ Object



45
46
47
48
# File 'lib/main/logger.rb', line 45

def write message 
  return message.to_s.size if @turned == :off
  super
end