Class: NilIO
Overview
NilIO emulates a null device (like /dev/null).
Instance Method Summary collapse
-
#read(length = nil, buffer = nil) ⇒ Object
Read form the null device.
-
#write(string) ⇒ Object
Write to the null device.
Instance Method Details
#read(length = nil, buffer = nil) ⇒ Object
Read form the null device. Always returns nil.
16 17 18 |
# File 'lib/nilio.rb', line 16 def read(length=nil, buffer=nil) nil end |
#write(string) ⇒ Object
Write to the null device. Ignores the string parameter, just returning its byte length
11 12 13 |
# File 'lib/nilio.rb', line 11 def write(string) string.to_s.bytesize end |