End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Pathname#extname
extname
ext/pathname/pathname.c
View on GitHub ↗
static VALUE
path_extname(VALUE self)
{
VALUE str = get_strpath(self);
return rb_funcall(rb_cFile, id_extname, 1, str);
}
Returns the file’s extension.
See File.extname.