123456789_123456789_123456789_123456789_123456789_

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

Instance Method Summary

Instance Attribute Details

#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.

[ GitHub ]

  
# 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