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
- #gets ⇒ Object
- #puts(*ary) ⇒ Object
-
#read(count = nil, _buffer = nil) ⇒ Object
Mimics IO#read with no data.
- #rewind ⇒ Object
- #size ⇒ Object
- #sync=(v) ⇒ Object
- #write(*ary) ⇒ Object
Instance Method Details
#close ⇒ Object
24 25 |
# File 'lib/puma/null_io.rb', line 24 def close end |
#each ⇒ Object
12 13 |
# File 'lib/puma/null_io.rb', line 12 def each end |
#eof? ⇒ Boolean
31 32 33 |
# File 'lib/puma/null_io.rb', line 31 def eof? true end |
#gets ⇒ Object
8 9 10 |
# File 'lib/puma/null_io.rb', line 8 def gets nil end |
#puts(*ary) ⇒ Object
38 39 |
# File 'lib/puma/null_io.rb', line 38 def puts(*ary) end |
#read(count = nil, _buffer = nil) ⇒ Object
Mimics IO#read with no data.
17 18 19 |
# File 'lib/puma/null_io.rb', line 17 def read(count = nil, _buffer = nil) (count && count > 0) ? nil : "" end |
#rewind ⇒ Object
21 22 |
# File 'lib/puma/null_io.rb', line 21 def rewind end |
#size ⇒ Object
27 28 29 |
# File 'lib/puma/null_io.rb', line 27 def size 0 end |
#sync=(v) ⇒ Object
35 36 |
# File 'lib/puma/null_io.rb', line 35 def sync=(v) end |
#write(*ary) ⇒ Object
41 42 |
# File 'lib/puma/null_io.rb', line 41 def write(*ary) end |