Wednesday, 1 April 2015

Use of 'require' in ruby

"require" means It allows you to import other source files into your programs

Please run below commands on rails console.

Input:   require "file_name"
Output:  true 
Description: load to the file

Input:    require "file_name"
Output: false
Note: It means file is already loaded

Input:    require "file_name"
Output: Error
Description: Means, here the file is not able to import, It something can be wrong.. check the file name or file does not exist...etc

No comments:

Post a Comment