Class: Puma::NullIO
- Inherits:
-
Object
- Object
- Puma::NullIO
- Defined in:
- lib/puma/null_io.rb
Overview
Provides an IO-like object that always appears to contain no data. Used as the value for rack.input when the request has no body.
Instance Method Summary collapse
- #close ⇒ Object
- #each ⇒ Object
- #eof? ⇒ Boolean
- #flush ⇒ Object
- #gets ⇒ Object
- #puts(*ary) ⇒ Object
-
#read(count = nil, _buffer = nil) ⇒ Object
Mimics IO#read with no data.
- #rewind ⇒ Object
- #size ⇒ Object
- #string ⇒ Object
- #sync ⇒ Object
- #sync=(v) ⇒ Object
- #write(*ary) ⇒ Object
Instance Method Details
#close ⇒ Object
28 29 |
# File 'lib/puma/null_io.rb', line 28 def close end |
#each ⇒ Object
16 17 |
# File 'lib/puma/null_io.rb', line 16 def each end |
#eof? ⇒ Boolean
35 36 37 |
# File 'lib/puma/null_io.rb', line 35 def eof? true end |
#flush ⇒ Object
52 53 54 |
# File 'lib/puma/null_io.rb', line 52 def flush self end |
#gets ⇒ Object
8 9 10 |
# File 'lib/puma/null_io.rb', line 8 def gets nil end |
#puts(*ary) ⇒ Object
46 47 |
# File 'lib/puma/null_io.rb', line 46 def puts(*ary) end |
#read(count = nil, _buffer = nil) ⇒ Object
Mimics IO#read with no data.
21 22 23 |
# File 'lib/puma/null_io.rb', line 21 def read(count = nil, _buffer = nil) count && count > 0 ? nil : "" end |
#rewind ⇒ Object
25 26 |
# File 'lib/puma/null_io.rb', line 25 def rewind end |
#size ⇒ Object
31 32 33 |
# File 'lib/puma/null_io.rb', line 31 def size 0 end |
#string ⇒ Object
12 13 14 |
# File 'lib/puma/null_io.rb', line 12 def string "" end |
#sync ⇒ Object
39 40 41 |
# File 'lib/puma/null_io.rb', line 39 def sync true end |
#sync=(v) ⇒ Object
43 44 |
# File 'lib/puma/null_io.rb', line 43 def sync=(v) end |
#write(*ary) ⇒ Object
49 50 |
# File 'lib/puma/null_io.rb', line 49 def write(*ary) end |