Module: Bj::Logger::OnOff

Defined in:
lib/bj/logger.rb

Instance Method Summary collapse

Instance Method Details

#turn(which) ⇒ Object



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

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

#write(message) ⇒ Object



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

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