Class: RubySmart::SimpleLogger::Devices::NullDevice
- Inherits:
-
Object
- Object
- RubySmart::SimpleLogger::Devices::NullDevice
- Defined in:
- lib/ruby_smart/simple_logger/devices/null_device.rb
Instance Attribute Summary collapse
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#clear! ⇒ Object
clears all logs.
-
#close ⇒ Object
disables writing.
-
#initialize ⇒ NullDevice
constructor
A new instance of NullDevice.
-
#logs ⇒ Array
returns logs.
-
#reopen ⇒ Object
enables writing.
- #write ⇒ Object (also: #<<)
Constructor Details
#initialize ⇒ NullDevice
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
#status ⇒ Object (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 |
#close ⇒ Object
disables writing
20 21 22 |
# File 'lib/ruby_smart/simple_logger/devices/null_device.rb', line 20 def close @status = false end |
#logs ⇒ Array
returns logs
36 37 38 |
# File 'lib/ruby_smart/simple_logger/devices/null_device.rb', line 36 def logs [] end |
#reopen ⇒ Object
enables writing
25 26 27 |
# File 'lib/ruby_smart/simple_logger/devices/null_device.rb', line 25 def reopen @status = true end |
#write ⇒ Object Also known as: <<
13 14 15 |
# File 'lib/ruby_smart/simple_logger/devices/null_device.rb', line 13 def write(*) nil end |