autoload(p1, p2)
public
Registers filename to be loaded (using Kernel::require) the first
time that module (which may be a String
or a symbol) is accessed in the namespace of mod.
module A
end
A.autoload(:B, "b")
A::B.doit
Show source
static VALUE
rb_mod_autoload(VALUE mod, VALUE sym, VALUE file)
{
ID id = rb_to_id(sym);
FilePathValue(file);
rb_autoload(mod, id, RSTRING_PTR(file));
return Qnil;
}