Class: StringIO
- Inherits:
-
Object
- Object
- StringIO
- Defined in:
- lib/io/stream/shim/buffered.rb,
lib/io/stream/shim/timeout.rb,
lib/io/stream/shim/readable.rb
Overview
StringIO extensions for buffering support.
Instance Method Summary collapse
-
#buffered=(value) ⇒ Object
Set the buffered state of the StringIO.
-
#buffered? ⇒ Boolean
Check if the StringIO is buffered.
-
#readable? ⇒ Boolean
Check if the StringIO is readable.
-
#timeout ⇒ Object
Return the configured timeout for this in-memory stream.
-
#timeout=(duration) ⇒ Object
Store timeout state for compatibility with IO-like timeout interfaces.
Instance Method Details
#buffered=(value) ⇒ Object
Set the buffered state of the StringIO.
77 78 79 |
# File 'lib/io/stream/shim/buffered.rb', line 77 def buffered=(value) self.sync = !value end |
#buffered? ⇒ Boolean
Check if the StringIO is buffered.
71 72 73 |
# File 'lib/io/stream/shim/buffered.rb', line 71 def buffered? return !self.sync end |
#readable? ⇒ Boolean
Check if the StringIO is readable.
45 46 47 |
# File 'lib/io/stream/shim/readable.rb', line 45 def readable? !eof? end |
#timeout ⇒ Object
Return the configured timeout for this in-memory stream.
12 13 14 |
# File 'lib/io/stream/shim/timeout.rb', line 12 def timeout @timeout end |
#timeout=(duration) ⇒ Object
Store timeout state for compatibility with IO-like timeout interfaces.
21 22 23 |
# File 'lib/io/stream/shim/timeout.rb', line 21 def timeout=(duration) @timeout = duration end |