def initialize(host_string_or_options_hash)
@keys = []
@local = false
if host_string_or_options_hash == :local
@local = true
@hostname = "localhost"
@user = ENV['USER'] || ENV['LOGNAME'] || ENV['USERNAME']
elsif !host_string_or_options_hash.is_a?(Hash)
@user, @hostname, @port = first_suitable_parser(host_string_or_options_hash).attributes
else
host_string_or_options_hash.each do |key, value|
if self.respond_to?("#{key}=")
send("#{key}=", value)
else
raise ArgumentError, "Unknown host property #{key}"
end
end
end
end