Skip to content

Commit 95a1110

Browse files
[DOC] Doc for StringIO.size (#171)
1 parent ff332ab commit 95a1110

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

doc/stringio/size.rdoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Returns the number of bytes in the string in +self+:
2+
3+
StringIO.new('hello').size # => 5 # Five 1-byte characters.
4+
StringIO.new('тест').size # => 8 # Four 2-byte characters.
5+
StringIO.new('こんにちは').size # => 15 # Five 3-byte characters.

ext/stringio/stringio.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1843,10 +1843,10 @@ strio_syswrite_nonblock(int argc, VALUE *argv, VALUE self)
18431843

18441844
/*
18451845
* call-seq:
1846-
* strio.length -> integer
1847-
* strio.size -> integer
1846+
* size -> integer
1847+
*
1848+
* :include: stringio/size.rdoc
18481849
*
1849-
* Returns the size of the buffer string.
18501850
*/
18511851
static VALUE
18521852
strio_size(VALUE self)

0 commit comments

Comments
 (0)