Is there a ruby equivalent to the PHP spl_autload_register? -


in php, use spl_autoload_register function lot. allows load classes on demand referenced. there way accomplish same thing in ruby?

you can mimic php __autoload() behavior (like defining classname filename algotithm , requiring it) redefining object#const_missing method, called when constant (like classname) not found.

here there's example.

(update: i've updated link above.)


Comments

Popular posts from this blog

jQuery clickable div with working mailto link inside -

WPF: binding viewmodel property of type DateTime to Calendar inside ItemsControl -

java - Getting corefrences with Standard corenlp package -