class StringIO
StringIO extensions for buffering support.
Definitions
def buffered?
Check if the StringIO is buffered.
Signature
-
returns
Boolean True if the StringIO is buffered (not synchronized).
Implementation
def buffered?
return !self.sync
end
def buffered=(value)
Set the buffered state of the StringIO.
Signature
-
parameter
valueBoolean True to enable buffering, false to disable.
Implementation
def buffered=(value)
self.sync = !value
end
def readable?
Check if the StringIO is readable.
Signature
-
returns
Boolean True if the StringIO is readable (not at EOF).
Implementation
def readable?
!eof?
end
def timeout
Return the configured timeout for this in-memory stream.
Signature
-
returns
Numeric | Nil The configured timeout, if any.
Implementation
def timeout
@timeout
end
def timeout=(duration)
Store timeout state for compatibility with IO-like timeout interfaces.
Signature
-
parameter
durationNumeric | Nil The timeout to assign.
-
returns
Numeric | Nil The assigned timeout.
Implementation
def timeout=(duration)
@timeout = duration
end