module Kernel
Public Instance Methods
autoload(cname, path)
click to toggle source
Instance level autoload method.
Note: I am not so certain the instance level method is a good idea. The end used can just as easily and more cleary use ‘self.class.autoload` to do it themselves. Nonetheless, Ruby supported this so we will too.
@param [#to_sym] cname
The constants name.
@param [String] path
File path to require.
@return [String] The $AUTOLOAD table.
# File lib/autoload.rb, line 35 def autoload(cname, path) $AUTOLOAD[[self.class, cname.to_sym]] << path end