Class: RIO::IOS::Null
Overview
Instance Method Summary
collapse
Methods included from Fail
#fcntl, #fileno, #ioctl, #notsupported, #pid, #stat, #sync, #sync=, #sysread, #sysseek, #syswrite, #to_i, #ungetc
Constructor Details
#initialize(el = nil, m = 'r') ⇒ Null
Returns a new instance of Null.
46
47
48
49
50
51
|
# File 'lib/rio/ios/null.rb', line 46
def initialize(el=nil,m='r')
@lineno = 0
@open = true
@mode = Mode.new(m)
@pos = 0
end
|
Instance Method Details
55
|
# File 'lib/rio/ios/null.rb', line 55
def <<(obj) self end
|
56
|
# File 'lib/rio/ios/null.rb', line 56
def binmode() self end
|
#callstr(func, *args) ⇒ Object
90
91
92
|
# File 'lib/rio/ios/null.rb', line 90
def callstr(func,*args)
self.class.to_s+'['+self.to_s+']'+'.'+func.to_s+'('+args.join(',')+')'
end
|
57
|
# File 'lib/rio/ios/null.rb', line 57
def close() @open = false end
|
#closed? ⇒ Boolean
60
|
# File 'lib/rio/ios/null.rb', line 60
def closed?() not @open end
|
#each(sep_string = $/, &block) ⇒ Object
61
|
# File 'lib/rio/ios/null.rb', line 61
def each(sep_string=$/,&block) self end
|
#each_byte(sep_string = $/, &block) ⇒ Object
63
|
# File 'lib/rio/ios/null.rb', line 63
def each_byte(sep_string=$/,&block) self end
|
#each_line(sep_string = $/, &block) ⇒ Object
62
|
# File 'lib/rio/ios/null.rb', line 62
def each_line(sep_string=$/,&block) self end
|
#eof? ⇒ Boolean
64
|
# File 'lib/rio/ios/null.rb', line 64
def eof?() true end
|
65
|
# File 'lib/rio/ios/null.rb', line 65
def flush() nil end
|
66
|
# File 'lib/rio/ios/null.rb', line 66
def fsync() nil end
|
67
|
# File 'lib/rio/ios/null.rb', line 67
def getc() nil end
|
#gets(sep_string = $/) ⇒ Object
68
|
# File 'lib/rio/ios/null.rb', line 68
def gets(sep_string=$/) nil end
|
70
|
# File 'lib/rio/ios/null.rb', line 70
def isatty() tty? end
|
71
|
# File 'lib/rio/ios/null.rb', line 71
def lineno() @lineno end
|
#lineno=(a) ⇒ Object
72
|
# File 'lib/rio/ios/null.rb', line 72
def lineno=(a) @lineno = a; lineno() end
|
73
|
# File 'lib/rio/ios/null.rb', line 73
def pos() 0 end
|
75
|
# File 'lib/rio/ios/null.rb', line 75
def pos=(v) @pos = v; pos end
|
#print(*objs) ⇒ Object
76
|
# File 'lib/rio/ios/null.rb', line 76
def print(*objs) nil end
|
#printf(format, *objs) ⇒ Object
77
|
# File 'lib/rio/ios/null.rb', line 77
def printf(format,*objs) nil end
|
#putc(obj) ⇒ Object
78
|
# File 'lib/rio/ios/null.rb', line 78
def putc(obj) nil end
|
#puts(*objs) ⇒ Object
79
|
# File 'lib/rio/ios/null.rb', line 79
def puts(*objs) nil end
|
#read(length = nil, *args) ⇒ Object
80
|
# File 'lib/rio/ios/null.rb', line 80
def read(length=nil,*args) length.nil? ? "" : nil end
|
81
|
# File 'lib/rio/ios/null.rb', line 81
def readchar() raise EOFError end
|
#readline(sep_string = $/) ⇒ Object
82
|
# File 'lib/rio/ios/null.rb', line 82
def readline(sep_string=$/) raise EOFError end
|
#readlines(sep_string = $/) ⇒ Object
83
|
# File 'lib/rio/ios/null.rb', line 83
def readlines(sep_string=$/) [] end
|
#readpartial(maxlen, *args) ⇒ Object
84
|
# File 'lib/rio/ios/null.rb', line 84
def readpartial(maxlen,*args) raise EOFError end
|
#reopen(*args) ⇒ Object
85
|
# File 'lib/rio/ios/null.rb', line 85
def reopen(*args) self end
|
86
|
# File 'lib/rio/ios/null.rb', line 86
def rewind() 0 end
|
#seek(amount, whence) ⇒ Object
87
|
# File 'lib/rio/ios/null.rb', line 87
def seek(amount,whence) 0 end
|
74
|
# File 'lib/rio/ios/null.rb', line 74
def tell() pos() end
|
#tty? ⇒ Boolean
69
|
# File 'lib/rio/ios/null.rb', line 69
def tty?() false end
|
#write(str) ⇒ Object
88
|
# File 'lib/rio/ios/null.rb', line 88
def write(str) str.length end
|