Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
StringIO#size
() -> ::Integer
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)) {
return INT2FIX(0);
}
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.3 · 3.2 · 3.1 · 3.0