Module: Main::Logger::OnOff

Defined in:
lib/main/logger.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) turn(which)



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

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

- (Object) write(message)



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

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