Class: Puma::NullIO
Relationships & Source Files | |
Inherits: | Object |
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 Attribute Summary
-
#closed? ⇒ Boolean
readonly
This is used as singleton class, so can’t have state.
- #eof? ⇒ Boolean readonly
- #sync rw
- #sync=(v) rw
Instance Method Summary
- #close
- #each
- #flush
- #gets
- #puts(*ary)
-
#read(count = nil, _buffer = nil)
Mimics
IO#read
with no data. - #rewind
- #size
- #string
- #write(*ary)
Instance Attribute Details
#closed? ⇒ Boolean
(readonly)
This is used as singleton class, so can’t have state.
# File 'lib/puma/null_io.rb', line 57
def closed? false end
#eof? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'lib/puma/null_io.rb', line 35
def eof? true end
#sync (rw)
[ GitHub ]# File 'lib/puma/null_io.rb', line 39
def sync true end
#sync=(v) (rw)
[ GitHub ]# File 'lib/puma/null_io.rb', line 43
def sync=(v) end
Instance Method Details
#close
[ GitHub ]# File 'lib/puma/null_io.rb', line 28
def close end
#each
[ GitHub ]# File 'lib/puma/null_io.rb', line 16
def each end
#flush
[ GitHub ]# File 'lib/puma/null_io.rb', line 52
def flush self end
#gets
[ GitHub ]# File 'lib/puma/null_io.rb', line 8
def gets nil end
#puts(*ary)
[ GitHub ]# File 'lib/puma/null_io.rb', line 46
def puts(*ary) end
#read(count = nil, _buffer = nil)
Mimics IO#read
with no data.
# File 'lib/puma/null_io.rb', line 21
def read(count = nil, _buffer = nil) count && count > 0 ? nil : "" end
#rewind
[ GitHub ]# File 'lib/puma/null_io.rb', line 25
def rewind end
#size
[ GitHub ]# File 'lib/puma/null_io.rb', line 31
def size 0 end
#string
[ GitHub ]# File 'lib/puma/null_io.rb', line 12
def string "" end
#write(*ary)
[ GitHub ]# File 'lib/puma/null_io.rb', line 49
def write(*ary) end