From: Nat Pryce Date: 2001-07-30T08:39:15+09:00 Subject: [ruby-talk:18767] Re: Guide to using class loading (or similar concepts) in Ruby? In Ruby you load entire files rather than individual classes. Basically, everything is a method of some object, even the require statements that import packages. Therefore you can put require statements in if statements and, most importantly, calculate the package name to be imported. E.g. in my code I do something like this: def load_transport_protocol( name ) if not @loaded_protocols.has_key? name # The script will instantiate a protocol and add it to the table or raise an error require 'transport_' + name end return @loaded_protocols[name] end