Automatically loading source files

suggest change

Kernel#autoload registers a filename to be loaded (using Kernel#require) the first time the named constant is accessed. The name may be a String or a Symbol.

autoload :MyModule, '/usr/local/lib/modules/my_module.rb'

Kernel#autoload? returns the filename to load if the name is registered with autoload.

autoload? :MyModule  #=> '/usr/local/lib/modules/my_module.rb'

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents