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
Does nothing.
-
#each ⇒ Object
Never yields.
-
#gets ⇒ Object
Always returns nil.
-
#read(count = nil, buffer = nil) ⇒ Object
Mimics IO#read with no data.
-
#rewind ⇒ Object
Does nothing.
Instance Method Details
#close ⇒ Object
Does nothing
31 32 |
# File 'lib/puma/null_io.rb', line 31 def close end |
#each ⇒ Object
Never yields
15 16 |
# File 'lib/puma/null_io.rb', line 15 def each end |
#gets ⇒ Object
Always returns nil
9 10 11 |
# File 'lib/puma/null_io.rb', line 9 def gets nil end |
#read(count = nil, buffer = nil) ⇒ Object
Mimics IO#read with no data
20 21 22 |
# File 'lib/puma/null_io.rb', line 20 def read(count=nil,buffer=nil) (count && count > 0) ? nil : "" end |
#rewind ⇒ Object
Does nothing
26 27 |
# File 'lib/puma/null_io.rb', line 26 def rewind end |