Module: Kernel

Defined in:
lib/capsule/autoimport.rb

Instance Method Summary collapse

Instance Method Details

#autoimport(mod, file) ⇒ Object

When the constant named by symbol mod is referenced, loads the script in filename using Capsule.load and defines the constant to be equal to the resulting Capsule module.

Use like Module#autoload. However, the underlying opertation is #load rather than #require, because scripts, unlike libraries, can be loaded more than once. See examples/autoscript-example.rb.

This method call ‘Object.autoimport` as defined in Module.



40
41
42
# File 'lib/capsule/autoimport.rb', line 40

def autoimport(mod, file)
  Object.autoimport(mod, file)
end