All pastes #45525 Raw Edit

Anonymous

public ruby v1 · immutable
#45525 ·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