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
22 23 |
# File 'lib/puma/null_io.rb', line 22 def close end |
#each ⇒ Object
10 11 |
# File 'lib/puma/null_io.rb', line 10 def each end |
#eof? ⇒ Boolean
29 30 31 |
# File 'lib/puma/null_io.rb', line 29 def eof? true end |
#gets ⇒ Object
6 7 8 |
# File 'lib/puma/null_io.rb', line 6 def gets nil end |
#puts(*ary) ⇒ Object
36 37 |
# File 'lib/puma/null_io.rb', line 36 def puts(*ary) end |
#read(count = nil, _buffer = nil) ⇒ Object
Mimics IO#read with no data.
15 16 17 |
# File 'lib/puma/null_io.rb', line 15 def read(count = nil, _buffer = nil) (count && count > 0) ? nil : "" end |
#rewind ⇒ Object
19 20 |
# File 'lib/puma/null_io.rb', line 19 def rewind end |
#size ⇒ Object
25 26 27 |
# File 'lib/puma/null_io.rb', line 25 def size 0 end |
#sync=(v) ⇒ Object
33 34 |
# File 'lib/puma/null_io.rb', line 33 def sync=(v) end |
#write(*ary) ⇒ Object
39 40 |
# File 'lib/puma/null_io.rb', line 39 def write(*ary) end |