class IO::Stream::Generic
def readable?
Whether there is a chance that a read operation will succeed or not.
def readable? # If we are at the end of the file, we can't read any more data: if @eof return false end # If the read buffer is not empty, we can read more data: if !@read_buffer.empty? return true end # If the underlying stream is readable, we can read more data: return !closed? end