Module: Bj::Logger::OnOff

Defined in:
lib/bj/logger.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) turn(which)



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

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

- (Object) write(message)



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

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