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.
autoload(:MyModule, "/usr/local/lib/modules/my_module.rb")
Show source
/*
* call-seq:
* autoload(module, filename) => nil
*
* Registers _filename_ to be loaded (using <code>Kernel::require</code>)
* the first time that _module_ (which may be a <code>String</code> or
* a symbol) is accessed.
*
* autoload(:MyModule, "/usr/local/lib/modules/my_module.rb")
*/
static VALUE
rb_f_autoload(obj, sym, file)
VALUE obj;
VALUE sym;
VALUE file;
{
if (NIL_P(ruby_cbase)) {
rb_raise(rb_eTypeError, "no class/module for autoload target");
}
return rb_mod_autoload(ruby_cbase, sym, file);
}