Module: Bj::Logger::OnOff

Defined in:
lib/bj/logger.rb

Instance Method Summary collapse

Instance Method Details

#turn(which) ⇒ Object



25
26
27
# File 'lib/bj/logger.rb', line 25

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

#write(message) ⇒ Object



29
30
31
32
# File 'lib/bj/logger.rb', line 29

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