Skip to content

Commit 3dc4ad2

Browse files
committed
[DOC] Emphasize #each_line instead of #each
1 parent 24eb59f commit 3dc4ad2

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

ext/stringio/stringio.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1431,9 +1431,9 @@ strio_readline(int argc, VALUE *argv, VALUE self)
14311431
* :markup: markdown
14321432
*
14331433
* call-seq:
1434-
* each(sep = $/, chomp: false) {|line| ... } -> self
1435-
* each(limit, chomp: false) {|line| ... } -> self
1436-
* each(sep, limit, chomp: false) {|line| ... } -> self
1434+
* each_line(sep = $/, chomp: false) {|line| ... } -> self
1435+
* each_line(limit, chomp: false) {|line| ... } -> self
1436+
* each_line(sep, limit, chomp: false) {|line| ... } -> self
14371437
*
14381438
* With a block given calls the block with each remaining line (see "Position" below) in the stream;
14391439
* returns `self`.
@@ -1447,7 +1447,7 @@ strio_readline(int argc, VALUE *argv, VALUE self)
14471447
*
14481448
* ```
14491449
* strio = StringIO.new(TEXT)
1450-
* strio.each {|line| p line }
1450+
* strio.each_line {|line| p line }
14511451
* strio.eof? # => true
14521452
* ```
14531453
*
@@ -1468,7 +1468,7 @@ strio_readline(int argc, VALUE *argv, VALUE self)
14681468
*
14691469
* ```
14701470
* strio = StringIO.new(TEXT)
1471-
* strio.each(' ') {|line| p line }
1471+
* strio.each_line(' ') {|line| p line }
14721472
* ```
14731473
*
14741474
* Output:
@@ -1489,7 +1489,7 @@ strio_readline(int argc, VALUE *argv, VALUE self)
14891489
*
14901490
* ```
14911491
* strio = StringIO.new(TEXT)
1492-
* strio.each(10) {|line| p line }
1492+
* strio.each_line(10) {|line| p line }
14931493
* ```
14941494
*
14951495
* Output:
@@ -1512,7 +1512,7 @@ strio_readline(int argc, VALUE *argv, VALUE self)
15121512
*
15131513
* ```
15141514
* strio = StringIO.new(TEXT)
1515-
* strio.each(' ', 10) {|line| p line }
1515+
* strio.each_line(' ', 10) {|line| p line }
15161516
* ```
15171517
*
15181518
* Output:
@@ -1538,7 +1538,7 @@ strio_readline(int argc, VALUE *argv, VALUE self)
15381538
* ```
15391539
* strio = StringIO.new(TEXT)
15401540
* strio.pos = 30 # Set stream position to character 30.
1541-
* strio.each {|line| p line }
1541+
* strio.each_line {|line| p line }
15421542
* ```
15431543
*
15441544
* Output:
@@ -1555,7 +1555,7 @@ strio_readline(int argc, VALUE *argv, VALUE self)
15551555
*
15561556
* ```
15571557
* strio = StringIO.new(TEXT)
1558-
* strio.each('') {|line| p line } # Read as paragraphs (separated by blank lines).
1558+
* strio.each_line('') {|line| p line } # Read as paragraphs (separated by blank lines).
15591559
* ```
15601560
*
15611561
* Output:
@@ -1567,7 +1567,7 @@ strio_readline(int argc, VALUE *argv, VALUE self)
15671567
*
15681568
* ```
15691569
* strio = StringIO.new(TEXT)
1570-
* strio.each(nil) {|line| p line } # "Slurp"; read it all.
1570+
* strio.each_line(nil) {|line| p line } # "Slurp"; read it all.
15711571
* ```
15721572
*
15731573
* Output:

0 commit comments

Comments
 (0)