2.10. Using Strings As IO Objects

Besides sprintf and scanf, there is another way to fake input/output to a string—the StringIO class.

Because this is a very IO-like object, we cover it in a later chapter. See section 10.1.24, “Treating a String As a File.”

Get The Ruby Way: Solutions and Techniques in Ruby Programming, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.