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

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -