Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Ruby
Autoloading objects — Ruby equivalent for PHP5 "__autoload
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Mat Schaffer, post: 4517598"] const_missing is a little more like PHP's __autoload function. The following, for example will attempt to just do: require <object =20 name> in the event it can't find the class. def Object.const_missing name require name.to_s.downcase const_get(name) end I've never used it though, so anyone can feel free to correct me for =20 any gotchas that I'm not aware of. -Mat= [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Ruby
Autoloading objects — Ruby equivalent for PHP5 "__autoload
Top