End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
StringIO#size
strio.size → integer
ext/stringio/stringio.c
View on GitHub ↗
static VALUE
strio_size(VALUE self)
{
VALUE string = StringIO(self)->string;
if (NIL_P(string)) {
rb_raise(rb_eIOError, "not opened");
}
return ULONG2NUM(RSTRING_LEN(string));
}
Returns the size of the buffer string.
See also
#set_encoding_by_bom
#string
#set_encoding
#string=
also in
4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.1