@@ -936,40 +936,7 @@ strio_get_sync(VALUE self)
936936 * call-seq:
937937 * each_byte {|byte| ... } -> self
938938 *
939- * With a block given, calls the block with each remaining byte in the stream;
940- * positions the stream at end-of-file;
941- * returns +self+:
942- *
943- * bytes = []
944- * strio = StringIO.new('hello') # Five 1-byte characters.
945- * strio.each_byte {|byte| bytes.push(byte) }
946- * strio.eof? # => true
947- * bytes # => [104, 101, 108, 108, 111]
948- * bytes = []
949- * strio = StringIO.new('тест') # Four 2-byte characters.
950- * strio.each_byte {|byte| bytes.push(byte) }
951- * bytes # => [209, 130, 208, 181, 209, 129, 209, 130]
952- * bytes = []
953- * strio = StringIO.new('こんにちは') # Five 3-byte characters.
954- * strio.each_byte {|byte| bytes.push(byte) }
955- * bytes # => [227, 129, 147, 227, 130, 147, 227, 129, 171, 227, 129, 161, 227, 129, 175]
956- *
957- * The position in the stream matters:
958- *
959- * bytes = []
960- * strio = StringIO.new('こんにちは')
961- * strio.getc # => "こ"
962- * strio.pos # => 3 # 3-byte character was read.
963- * strio.each_byte {|byte| bytes.push(byte) }
964- * bytes # => [227, 130, 147, 227, 129, 171, 227, 129, 161, 227, 129, 175]
965- *
966- * If at end-of-file, does not call the block:
967- *
968- * strio.eof? # => true
969- * strio.each_byte {|byte| fail 'Boo!' }
970- * strio.eof? # => true
971- *
972- * With no block given, returns a new {Enumerator}[https://docs.ruby-lang.org/en/master/Enumerator.html].
939+ * :include: stringio/each_byte.rdoc
973940 *
974941 * Related: StringIO#each_char, StringIO#each_codepoint, StringIO#each_line.
975942 */
@@ -1196,40 +1163,7 @@ strio_readbyte(VALUE self)
11961163 * call-seq:
11971164 * each_char {|char| ... } -> self
11981165 *
1199- * With a block given, calls the block with each remaining character in the stream;
1200- * positions the stream at end-of-file;
1201- * returns +self+:
1202- *
1203- * chars = []
1204- * strio = StringIO.new('hello')
1205- * strio.each_char {|char| chars.push(char) }
1206- * strio.eof? # => true
1207- * chars # => ["h", "e", "l", "l", "o"]
1208- * chars = []
1209- * strio = StringIO.new('тест')
1210- * strio.each_char {|char| chars.push(char) }
1211- * chars # => ["т", "е", "с", "т"]
1212- * chars = []
1213- * strio = StringIO.new('こんにちは')
1214- * strio.each_char {|char| chars.push(char) }
1215- * chars # => ["こ", "ん", "に", "ち", "は"]
1216- *
1217- * Stream position matters:
1218- *
1219- * chars = []
1220- * strio = StringIO.new('こんにちは')
1221- * strio.getc # => "こ"
1222- * strio.pos # => 3 # 3-byte character was read.
1223- * strio.each_char {|char| chars.push(char) }
1224- * chars # => ["ん", "に", "ち", "は"]
1225- *
1226- * When at end-of-stream does not call the block:
1227- *
1228- * strio.eof? # => true
1229- * strio.each_char {|char| fail 'Boo!' }
1230- * strio.eof? # => true
1231- *
1232- * With no block given, returns a new {Enumerator}[https://docs.ruby-lang.org/en/master/Enumerator.html].
1166+ * :include: stringio/each_char.rdoc
12331167 *
12341168 * Related: StringIO#each_byte, StringIO#each_codepoint, StringIO#each_line.
12351169 */
@@ -1250,42 +1184,7 @@ strio_each_char(VALUE self)
12501184 * call-seq:
12511185 * each_codepoint {|codepoint| ... } -> self
12521186 *
1253- * With a block given, calls the block with each successive codepoint from self;
1254- * sets the position to end-of-stream;
1255- * returns +self+.
1256- *
1257- * Each codepoint is the integer value for a character; returns self:
1258- *
1259- * codepoints = []
1260- * strio = StringIO.new('hello')
1261- * strio.each_codepoint {|codepoint| codepoints.push(codepoint) }
1262- * strio.eof? # => true
1263- * codepoints # => [104, 101, 108, 108, 111]
1264- * codepoints = []
1265- * strio = StringIO.new('тест')
1266- * strio.each_codepoint {|codepoint| codepoints.push(codepoint) }
1267- * codepoints # => [1090, 1077, 1089, 1090]
1268- * codepoints = []
1269- * strio = StringIO.new('こんにちは')
1270- * strio.each_codepoint {|codepoint| codepoints.push(codepoint) }
1271- * codepoints # => [12371, 12435, 12395, 12385, 12399]
1272- *
1273- * Position in the stream matters:
1274- *
1275- * codepoints = []
1276- * strio = StringIO.new('こんにちは')
1277- * strio.getc # => "こ"
1278- * strio.pos # => 3
1279- * strio.each_codepoint {|codepoint| codepoints.push(codepoint) }
1280- * codepoints # => [12435, 12395, 12385, 12399]
1281- *
1282- * When at end-of-stream, the block is not called:
1283- *
1284- * strio.eof? # => true
1285- * strio.each_codepoint {|codepoint| fail 'Boo!' }
1286- * strio.eof? # => true
1287- *
1288- * With no block given, returns a new {Enumerator}[https://docs.ruby-lang.org/en/master/Enumerator.html].
1187+ * :include: stringio/each_codepoint.rdoc
12891188 *
12901189 * Related: StringIO#each_byte, StringIO#each_char, StringIO#each_line.
12911190 */
0 commit comments