What is the purpose of load, auto_load, and require_relative in Ruby?

What is the purpose of load, auto_load, and require_relative in Ruby?



-Load allows the process or a method to be loaded in the memory and it actually processes the execution of the program used in a separate file.

It includes the classes, modules, methods and other files that executes in the current scope that is being defined.
It performs the inclusion operation and reprocesses the whole code every time the load is being called.

-Auto_load: this initiates the method that is in hat file and allows the interpreter to call the method.

-require_relative: allows the loading to take place of the local folders and files.
Post your comment