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