Class: StringIO

Inherits:
Object
  • Object
show all
Defined in:
lib/io/stream/shim/buffered.rb,
lib/io/stream/shim/readable.rb

Overview

StringIO extensions for buffering support.

Instance Method Summary collapse

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.

Returns:

  • (Boolean)


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.

Returns:

  • (Boolean)


45
46
47
# File 'lib/io/stream/shim/readable.rb', line 45

def readable?
  !eof?
end