Class: PumaPlus::Input::NullIO

Inherits:
Object
  • Object
show all
Defined in:
lib/puma_plus/input.rb

Overview

An empty rack.input.

Transcribed from puma/lib/puma/null_io.rb rather than depended upon: the class is a handful of methods, and the gem takes no dependencies.

Instance Method Summary collapse

Instance Method Details

#closeObject



15
# File 'lib/puma_plus/input.rb', line 15

def close; end

#closed?Boolean

Returns:

  • (Boolean)


21
# File 'lib/puma_plus/input.rb', line 21

def closed? = false

#eachObject



14
# File 'lib/puma_plus/input.rb', line 14

def each; end

#eof?Boolean

Returns:

  • (Boolean)


17
# File 'lib/puma_plus/input.rb', line 17

def eof? = true

#getsObject



13
# File 'lib/puma_plus/input.rb', line 13

def gets = nil

#read(count = nil, buffer = nil) ⇒ Object



28
29
30
31
32
33
34
35
36
# File 'lib/puma_plus/input.rb', line 28

def read(count = nil, buffer = nil)
  result = count.nil? || count.zero? ? "" : nil
  if buffer
    buffer.clear
    buffer << result if result
    return count.nil? || count.zero? ? buffer : nil
  end
  result
end

#read_nsObject



22
# File 'lib/puma_plus/input.rb', line 22

def read_ns = 0

#readpartial(_count, buffer = nil) ⇒ Object

Raises:

  • (EOFError)


38
39
40
41
42
43
# File 'lib/puma_plus/input.rb', line 38

def readpartial(_count, buffer = nil)
  raise EOFError if buffer.nil?

  buffer.clear
  raise EOFError
end

#rewindObject



18
# File 'lib/puma_plus/input.rb', line 18

def rewind = 0

#sizeObject



16
# File 'lib/puma_plus/input.rb', line 16

def size = 0

#stringObject



20
# File 'lib/puma_plus/input.rb', line 20

def string = ""

#syncObject



19
# File 'lib/puma_plus/input.rb', line 19

def sync = true

#sync=(value) ⇒ Object



24
25
26
# File 'lib/puma_plus/input.rb', line 24

def sync=(value)
  value
end