Class: DevNull
- Inherits:
-
Object
- Object
- DevNull
- Defined in:
- lib/devnull.rb
Instance Method Summary collapse
- #<<(obj) ⇒ Object
- #autoclose=(arg) ⇒ Object
- #autoclose? ⇒ Boolean
- #binmode ⇒ Object
- #binmode? ⇒ Boolean
-
#close ⇒ Object
– methods that do nothing ++.
- #close_on_exec=(arg) ⇒ Object
- #close_on_exec? ⇒ Boolean
- #close_read ⇒ Object
- #close_write ⇒ Object
- #closed? ⇒ Boolean
- #closed_read? ⇒ Boolean
- #closed_write? ⇒ Boolean
- #each(*args) ⇒ Object (also: #each_line, #lines, #each_byte, #bytes, #each_char, #chars, #each_codepoint, #codepoints)
- #eof ⇒ Object
- #eof? ⇒ Boolean
- #external_encoding ⇒ Object
- #fcntl(arg1, arg2) ⇒ Object
- #fdatasync ⇒ Object
-
#fileno ⇒ Object
(also: #to_i)
– methods treated as being not implemented ++.
- #flush ⇒ Object
- #fsync ⇒ Object
- #getbyte ⇒ Object
-
#getc ⇒ Object
– methods that do nothing and returns something ++.
- #gets(arg1 = nil, arg2 = nil) ⇒ Object
-
#initialize ⇒ DevNull
constructor
A new instance of DevNull.
- #internal_encoding ⇒ Object
- #ioctl(arg1, arg2) ⇒ Object
- #isatty ⇒ Object
- #lineno ⇒ Object
- #lineno=(arg) ⇒ Object
- #path ⇒ Object
- #pid ⇒ Object
- #pos ⇒ Object
- #pos=(arg) ⇒ Object
- #print(*args) ⇒ Object
- #printf(arg1, *other_args) ⇒ Object
- #putc(arg) ⇒ Object
- #puts(*args) ⇒ Object
- #read(len = 0, outbuf = nil) ⇒ Object
- #read_nonblock(arg1, arg2 = nil) ⇒ Object
- #readbyte ⇒ Object
- #readchar ⇒ Object
- #readline(arg1 = nil, arg2 = nil) ⇒ Object
- #readlines(arg1 = nil, arg2 = nil) ⇒ Object
- #readpartial(arg1, arg2 = nil) ⇒ Object
- #reopen(arg1, arg2 = nil) ⇒ Object
- #rewind ⇒ Object
- #seek(arg1, arg2 = nil) ⇒ Object
- #set_encoding(arg1, arg2 = nil, arg3 = nil) ⇒ Object
- #stat ⇒ Object
- #sync ⇒ Object
- #sync=(arg) ⇒ Object
- #sysread(arg1, arg2 = nil) ⇒ Object
- #sysseek(arg1, arg2 = nil) ⇒ Object
- #syswrite(arg) ⇒ Object
- #tell ⇒ Object
- #to_io ⇒ Object
- #truncate(arg) ⇒ Object
- #tty? ⇒ Boolean
- #ungetbyte(arg) ⇒ Object
- #ungetc(arg) ⇒ Object
- #write(arg) ⇒ Object
- #write_nonblock(arg) ⇒ Object
Constructor Details
#initialize ⇒ DevNull
Returns a new instance of DevNull.
38 39 40 |
# File 'lib/devnull.rb', line 38 def initialize # do nothing end |
Instance Method Details
#<<(obj) ⇒ Object
77 |
# File 'lib/devnull.rb', line 77 def <<(obj); self; end |
#autoclose=(arg) ⇒ Object
106 |
# File 'lib/devnull.rb', line 106 def autoclose=(arg); arg; end |
#autoclose? ⇒ Boolean
83 |
# File 'lib/devnull.rb', line 83 def autoclose?; true; end |
#binmode ⇒ Object
78 |
# File 'lib/devnull.rb', line 78 def binmode; self; end |
#binmode? ⇒ Boolean
84 |
# File 'lib/devnull.rb', line 84 def binmode?; true; end |
#close ⇒ Object
– methods that do nothing ++
56 |
# File 'lib/devnull.rb', line 56 def close; end |
#close_on_exec=(arg) ⇒ Object
107 |
# File 'lib/devnull.rb', line 107 def close_on_exec=(arg); arg; end |
#close_on_exec? ⇒ Boolean
90 |
# File 'lib/devnull.rb', line 90 def close_on_exec?; false; end |
#close_read ⇒ Object
57 |
# File 'lib/devnull.rb', line 57 def close_read; end |
#close_write ⇒ Object
58 |
# File 'lib/devnull.rb', line 58 def close_write; end |
#closed? ⇒ Boolean
85 |
# File 'lib/devnull.rb', line 85 def closed?; true; end |
#closed_read? ⇒ Boolean
91 |
# File 'lib/devnull.rb', line 91 def closed_read?; false; end |
#closed_write? ⇒ Boolean
92 |
# File 'lib/devnull.rb', line 92 def closed_write?; false; end |
#each(*args) ⇒ Object Also known as: each_line, lines, each_byte, bytes, each_char, chars, each_codepoint, codepoints
116 |
# File 'lib/devnull.rb', line 116 def each(*args); (block_given? ? self : [].to_enum); end |
#eof ⇒ Object
86 |
# File 'lib/devnull.rb', line 86 def eof; true; end |
#eof? ⇒ Boolean
87 |
# File 'lib/devnull.rb', line 87 def eof?; true; end |
#external_encoding ⇒ Object
73 |
# File 'lib/devnull.rb', line 73 def external_encoding; nil; end |
#fcntl(arg1, arg2) ⇒ Object
50 |
# File 'lib/devnull.rb', line 50 def fcntl(arg1, arg2); raise NotImplementedError; end |
#fdatasync ⇒ Object
48 |
# File 'lib/devnull.rb', line 48 def fdatasync; raise NotImplementedError; end |
#fileno ⇒ Object Also known as: to_i
– methods treated as being not implemented ++
45 |
# File 'lib/devnull.rb', line 45 def fileno; raise NotImplementedError; end |
#flush ⇒ Object
79 |
# File 'lib/devnull.rb', line 79 def flush; self; end |
#fsync ⇒ Object
47 |
# File 'lib/devnull.rb', line 47 def fsync; raise NotImplementedError; end |
#getbyte ⇒ Object
69 |
# File 'lib/devnull.rb', line 69 def getbyte; nil; end |
#getc ⇒ Object
– methods that do nothing and returns something ++
68 |
# File 'lib/devnull.rb', line 68 def getc; nil; end |
#gets(arg1 = nil, arg2 = nil) ⇒ Object
70 |
# File 'lib/devnull.rb', line 70 def gets(arg1=nil, arg2=nil); nil; end |
#internal_encoding ⇒ Object
74 |
# File 'lib/devnull.rb', line 74 def internal_encoding; nil; end |
#ioctl(arg1, arg2) ⇒ Object
51 |
# File 'lib/devnull.rb', line 51 def ioctl(arg1, arg2); raise NotImplementedError; end |
#isatty ⇒ Object
93 |
# File 'lib/devnull.rb', line 93 def isatty; false; end |
#lineno ⇒ Object
96 |
# File 'lib/devnull.rb', line 96 def lineno; 0; end |
#lineno=(arg) ⇒ Object
108 |
# File 'lib/devnull.rb', line 108 def lineno=(arg); arg; end |
#path ⇒ Object
71 |
# File 'lib/devnull.rb', line 71 def path; nil; end |
#pid ⇒ Object
72 |
# File 'lib/devnull.rb', line 72 def pid; nil; end |
#pos ⇒ Object
97 |
# File 'lib/devnull.rb', line 97 def pos; 0; end |
#pos=(arg) ⇒ Object
109 |
# File 'lib/devnull.rb', line 109 def pos=(arg); arg; end |
#print(*args) ⇒ Object
59 |
# File 'lib/devnull.rb', line 59 def print(*args); end |
#printf(arg1, *other_args) ⇒ Object
60 |
# File 'lib/devnull.rb', line 60 def printf(arg1, *other_args); end |
#putc(arg) ⇒ Object
105 |
# File 'lib/devnull.rb', line 105 def putc(arg); arg; end |
#puts(*args) ⇒ Object
61 |
# File 'lib/devnull.rb', line 61 def puts(*args); end |
#read(len = 0, outbuf = nil) ⇒ Object
133 134 135 136 137 138 139 140 |
# File 'lib/devnull.rb', line 133 def read(len = 0, outbuf = nil) if outbuf != nil outbuf.replace("") outbuf else (len.to_i == 0 ? "" : nil) end end |
#read_nonblock(arg1, arg2 = nil) ⇒ Object
128 |
# File 'lib/devnull.rb', line 128 def read_nonblock(arg1, arg2=nil); raise EOFError; end |
#readbyte ⇒ Object
130 |
# File 'lib/devnull.rb', line 130 def readbyte; raise EOFError; end |
#readchar ⇒ Object
129 |
# File 'lib/devnull.rb', line 129 def readchar; raise EOFError; end |
#readline(arg1 = nil, arg2 = nil) ⇒ Object
131 |
# File 'lib/devnull.rb', line 131 def readline(arg1=nil, arg2=nil); raise EOFError; end |
#readlines(arg1 = nil, arg2 = nil) ⇒ Object
103 |
# File 'lib/devnull.rb', line 103 def readlines(arg1=nil, arg2=nil); []; end |
#readpartial(arg1, arg2 = nil) ⇒ Object
127 |
# File 'lib/devnull.rb', line 127 def readpartial(arg1, arg2=nil); raise EOFError; end |
#reopen(arg1, arg2 = nil) ⇒ Object
80 |
# File 'lib/devnull.rb', line 80 def reopen(arg1, arg2=nil); self; end |
#rewind ⇒ Object
99 |
# File 'lib/devnull.rb', line 99 def rewind; 0; end |
#seek(arg1, arg2 = nil) ⇒ Object
100 |
# File 'lib/devnull.rb', line 100 def seek(arg1, arg2=nil); 0; end |
#set_encoding(arg1, arg2 = nil, arg3 = nil) ⇒ Object
81 |
# File 'lib/devnull.rb', line 81 def set_encoding(arg1, arg2=nil, arg3=nil); self; end |
#stat ⇒ Object
49 |
# File 'lib/devnull.rb', line 49 def stat; raise NotImplementedError; end |
#sync ⇒ Object
88 |
# File 'lib/devnull.rb', line 88 def sync; true; end |
#sync=(arg) ⇒ Object
110 |
# File 'lib/devnull.rb', line 110 def sync=(arg); arg; end |
#sysread(arg1, arg2 = nil) ⇒ Object
126 |
# File 'lib/devnull.rb', line 126 def sysread(arg1, arg2=nil); raise EOFError; end |
#sysseek(arg1, arg2 = nil) ⇒ Object
101 |
# File 'lib/devnull.rb', line 101 def sysseek(arg1, arg2=nil); 0; end |
#syswrite(arg) ⇒ Object
113 |
# File 'lib/devnull.rb', line 113 def syswrite(arg); arg.to_s.length; end |
#tell ⇒ Object
98 |
# File 'lib/devnull.rb', line 98 def tell; 0; end |
#to_io ⇒ Object
76 |
# File 'lib/devnull.rb', line 76 def to_io; self; end |
#truncate(arg) ⇒ Object
111 |
# File 'lib/devnull.rb', line 111 def truncate(arg); arg; end |
#tty? ⇒ Boolean
94 |
# File 'lib/devnull.rb', line 94 def tty?; false; end |
#ungetbyte(arg) ⇒ Object
62 |
# File 'lib/devnull.rb', line 62 def ungetbyte(arg); end |
#ungetc(arg) ⇒ Object
63 |
# File 'lib/devnull.rb', line 63 def ungetc(arg); end |
#write(arg) ⇒ Object
112 |
# File 'lib/devnull.rb', line 112 def write(arg); arg.to_s.length; end |
#write_nonblock(arg) ⇒ Object
114 |
# File 'lib/devnull.rb', line 114 def write_nonblock(arg); arg.to_s.length; end |