Miscellany
public ruby v1 · immutable def self.factory( type, *params ) @@Types ||= Hash.new( "ssh" => SSHConnection, "socket" => UnixSockConnection, "inetd" => InetConnection, "local" => LocalConnection, "net_ssh" => NetSSHConnection ) object = @@Types[type] unless object raise( ArgumentError, "Supplied connection type \"" + type + "\" is not available." ) end return object.new( *params ) end