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.
- #puts(*ary) ⇒ Object
-
#read(count = nil, buffer = nil) ⇒ Object
Mimics IO#read with no data.
-
#rewind ⇒ Object
Does nothing.
-
#size ⇒ Object
Always zero.
- #sync=(v) ⇒ Object
- #write(*ary) ⇒ Object
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 |
#puts(*ary) ⇒ Object
43 44 |
# File 'lib/puma/null_io.rb', line 43 def puts(*ary) 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 |
#size ⇒ Object
Always zero
36 37 38 |
# File 'lib/puma/null_io.rb', line 36 def size 0 end |
#sync=(v) ⇒ Object
40 41 |
# File 'lib/puma/null_io.rb', line 40 def sync=(v) end |
#write(*ary) ⇒ Object
46 47 |
# File 'lib/puma/null_io.rb', line 46 def write(*ary) end |