Represents a site to which HTTP connections are made. It is a value object, and is suitable for use in a hash. If two sites are equal, then a persistent connection made to the first site, can be re-used for the second.
@api private
# File lib/puppet/network/http/site.rb, line 22 def ==(rhs) (@scheme == rhs.scheme) && (@host == rhs.host) && (@port == rhs.port) end
# File lib/puppet/network/http/site.rb, line 17 def addr "#{@scheme}://#{@host}:#{@port.to_s}" end
# File lib/puppet/network/http/site.rb, line 28 def hash [@scheme, @host, @port].hash end
# File lib/puppet/network/http/site.rb, line 36 def move_to(uri) self.class.new(uri.scheme, uri.host, uri.port) end
# File lib/puppet/network/http/site.rb, line 32 def use_ssl? @scheme == 'https' end
# File lib/puppet/network/http/site.rb, line 11 def initialize(scheme, host, port) @scheme = scheme @host = host @port = port.to_i end