From: Mike Stephens Date: 2009-11-18T03:20:28+09:00 Subject: Re: Class inside a Method Body My concern here is when you use libraries. When your user just wants to get a list of product categories from the web server, you seem to risk Ruby parsing the whole portfolio of library capabilities despite the fact you emphatically won't use 99% of them on that transaction. Autoload does look as though it addresses this. The other solution you mentioned was you put require inside a method and then Ruby won't execute it until control passes to the method, so if you don't need that method, you don't incur the cost of interpreting it. Presumably you can't add classes this way and, from a glance at The Ruby Programming Language (Flanagan & Matsumoto), there is a risk the included code gets treated as belonging to a different scope to the calling method (although that might be a plus point). -- Posted via http://www.ruby-forum.com/.