adspace


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

Answer Posted / Ankush Kumar

load: Loads a Ruby file into the current runtime environment. It searches for files in $LOAD_PATH (the list of directories where Ruby looks for libraries).nauto_load: Automatically loads a Ruby file when a constant referenced within that file is first accessed.nrequire_relative: Requires the relative path to another Ruby file, and it only searches the directories in the current directory's hierarchy.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the current version of ruby on rails?

949