Skip to content

Commit f762e50

Browse files
BurdetteLamarmatzbot
authored andcommitted
[ruby/stringio] [DOC] Tweaks for StringIO.open
(ruby/stringio#146) ruby/stringio@141c6c0edf
1 parent 4368e6c commit f762e50

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

ext/stringio/stringio.c

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -370,23 +370,20 @@ strio_finalize(VALUE self)
370370

371371
/*
372372
* call-seq:
373-
* StringIO.open(string = '', mode = 'r+') {|strio| ... }
373+
* StringIO.open(string = '', mode = 'r+') -> new_stringio
374+
* StringIO.open(string = '', mode = 'r+') {|strio| ... } -> object
374375
*
375-
* Note that +mode+ defaults to <tt>'r'</tt> if +string+ is frozen.
376-
*
377-
* Creates a new \StringIO instance formed from +string+ and +mode+;
378-
* see {Access Modes}[rdoc-ref:File@Access+Modes].
376+
* Creates new \StringIO instance by calling <tt>StringIO.new(string, mode)</tt>.
379377
*
380-
* With no block, returns the new instance:
378+
* With no block given, returns the new instance:
381379
*
382380
* strio = StringIO.open # => #<StringIO>
383381
*
384-
* With a block, calls the block with the new instance
382+
* With a block given, calls the block with the new instance
385383
* and returns the block's value;
386-
* closes the instance on block exit.
384+
* closes the instance on block exit:
387385
*
388-
* StringIO.open {|strio| p strio }
389-
* # => #<StringIO>
386+
* StringIO.open('foo') {|strio| strio.string.upcase } # => "FOO"
390387
*
391388
* Related: StringIO.new.
392389
*/

0 commit comments

Comments
 (0)