All pastes #45526 Raw Edit

Miscellany

public ruby v1 · immutable
#45526 ·published 2006-03-13 22:58 UTC
rendered paste body
	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