End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
StringIO#length
strio.length → 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));
}
Alias of #size
Returns the size of the buffer string.