Class | StringIO |
In: |
ext/stringio/stringio.c
|
Parent: | Data |
Pseudo I/O on String object.
Equivalent to StringIO.new except that when it is called with a block, it yields with the new instance and closes it, and returns the result which returned from the block.
Closes strio. The strio is unavailable for any further data operations; an IOError is raised if such an attempt is made.
See IO#each.
See IO#each.
Returns true if strio is at end of file. The stringio must be opened for reading or an IOError will be raised.
Returns true if strio is at end of file. The stringio must be opened for reading or an IOError will be raised.
Manually sets the current line number to the given value. $. is updated only on the next read.
Reinitializes strio with the given other_StrIO or string and mode (see StringIO#new).
Seeks to a given offset amount in the stream according to the value of whence (see IO#seek).
Similar to read, but raises EOFError at end of string instead of returning nil, as well as IO#sysread does.
Truncates the buffer string to at most integer bytes. The strio must be opened for writing.
ruby-doc.org is a service of James Britt and Neurogami, a Ruby application development company in Phoenix, AZ.
Documentation content on ruby-doc.org is provided by remarkable members of the Ruby community.
For more information on the Ruby programming language, visit ruby-lang.org.
Want to help improve Ruby's API docs? See Ruby Documentation Guidelines.