Class: RubySmart::SimpleLogger::Devices::NullDevice

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_smart/simple_logger/devices/null_device.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeNullDevice

Returns a new instance of NullDevice.



9
10
11
# File 'lib/ruby_smart/simple_logger/devices/null_device.rb', line 9

def initialize
  @status = true
end

Instance Attribute Details

#statusObject (readonly)

Returns the value of attribute status.



7
8
9
# File 'lib/ruby_smart/simple_logger/devices/null_device.rb', line 7

def status
  @status
end

Instance Method Details

#clear!Object

clears all logs



30
31
32
# File 'lib/ruby_smart/simple_logger/devices/null_device.rb', line 30

def clear!
  nil
end

#closeObject

disables writing



20
21
22
# File 'lib/ruby_smart/simple_logger/devices/null_device.rb', line 20

def close
  @status = false
end

#logsArray

returns logs

Returns:

  • (Array)

    logs



36
37
38
# File 'lib/ruby_smart/simple_logger/devices/null_device.rb', line 36

def logs
  []
end

#reopenObject

enables writing



25
26
27
# File 'lib/ruby_smart/simple_logger/devices/null_device.rb', line 25

def reopen
  @status = true
end

#writeObject Also known as: <<



13
14
15
# File 'lib/ruby_smart/simple_logger/devices/null_device.rb', line 13

def write(*)
  nil
end