Class: PumaPlus::Input::NullIO
- Inherits:
-
Object
- Object
- PumaPlus::Input::NullIO
- 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
- #close ⇒ Object
- #closed? ⇒ Boolean
- #each ⇒ Object
- #eof? ⇒ Boolean
- #gets ⇒ Object
- #read(count = nil, buffer = nil) ⇒ Object
- #read_ns ⇒ Object
- #readpartial(_count, buffer = nil) ⇒ Object
- #rewind ⇒ Object
- #size ⇒ Object
- #string ⇒ Object
- #sync ⇒ Object
- #sync=(value) ⇒ Object
Instance Method Details
#close ⇒ Object
15 |
# File 'lib/puma_plus/input.rb', line 15 def close; end |
#closed? ⇒ Boolean
21 |
# File 'lib/puma_plus/input.rb', line 21 def closed? = false |
#each ⇒ Object
14 |
# File 'lib/puma_plus/input.rb', line 14 def each; end |
#eof? ⇒ Boolean
17 |
# File 'lib/puma_plus/input.rb', line 17 def eof? = true |
#gets ⇒ Object
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_ns ⇒ Object
22 |
# File 'lib/puma_plus/input.rb', line 22 def read_ns = 0 |
#readpartial(_count, buffer = nil) ⇒ Object
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 |
#rewind ⇒ Object
18 |
# File 'lib/puma_plus/input.rb', line 18 def rewind = 0 |
#size ⇒ Object
16 |
# File 'lib/puma_plus/input.rb', line 16 def size = 0 |
#string ⇒ Object
20 |
# File 'lib/puma_plus/input.rb', line 20 def string = "" |
#sync ⇒ Object
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 |