How can I clear a StringIO
instance? After I write to and read from a string io, I want to clear it.
require "stringio"
io = StringIO.new
io.write("foo")
io.string #=> "foo"
# ... After doing something ...
io.string #=> Expecting ""
I tried flush
and rewind
, but I still get the same content.