class Puppet::Network::HTTP::Site

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

Attributes

host[R]
port[R]
scheme[R]

Public Instance Methods

==(rhs) click to toggle source
# File lib/puppet/network/http/site.rb, line 22
def ==(rhs)
  (@scheme == rhs.scheme) && (@host == rhs.host) && (@port == rhs.port)
end
Also aliased as: eql?
addr() click to toggle source
# File lib/puppet/network/http/site.rb, line 17
def addr
  "#{@scheme}://#{@host}:#{@port.to_s}"
end
Also aliased as: to_s
eql?(rhs) click to toggle source
Alias for: ==
hash() click to toggle source
# File lib/puppet/network/http/site.rb, line 28
def hash
  [@scheme, @host, @port].hash
end
move_to(uri) click to toggle source
# File lib/puppet/network/http/site.rb, line 36
def move_to(uri)
  self.class.new(uri.scheme, uri.host, uri.port)
end
to_s() click to toggle source
Alias for: addr
use_ssl?() click to toggle source
# File lib/puppet/network/http/site.rb, line 32
def use_ssl?
  @scheme == 'https'
end

Public Class Methods

new(scheme, host, port) click to toggle source
# File lib/puppet/network/http/site.rb, line 11
def initialize(scheme, host, port)
  @scheme = scheme
  @host = host
  @port = port.to_i
end