From c6c6a74fed7aa5d73d13bd98f3e6204002eeec32 Mon Sep 17 00:00:00 2001 From: hsbt Date: Thu, 6 Feb 2014 03:08:38 +0000 Subject: * ext/stringio/stringio.c: [DOC] add docs and example by @schneems [ci skip] [fix GH-527] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44859 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/stringio/stringio.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'ext') diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c index 3fef619de6..db3732e072 100644 --- a/ext/stringio/stringio.c +++ b/ext/stringio/stringio.c @@ -1493,6 +1493,16 @@ strio_set_encoding(int argc, VALUE *argv, VALUE self) /* * Pseudo I/O on String object. + * + * Commonly used to simulate `$stdio` or `$stderr` + * + * === Examples + * + * require 'stringio' + * + * io = StringIO.new + * io.puts "Hello World" + * io.string #=> "Hello World" */ void Init_stringio() -- cgit v1.2.3