Class: Puppetserver::Ca::Utils::HttpClient::URL

Inherits:
Struct
  • Object
show all
Defined in:
lib/puppetserver/ca/utils/http_client.rb

Overview

Like URI, but not… maybe of suspicious value

Instance Method Summary collapse

Instance Method Details

#full_urlObject



165
166
167
168
169
170
171
# File 'lib/puppetserver/ca/utils/http_client.rb', line 165

def full_url
  url = protocol + '://' + host + ':' + port + '/' +
        [endpoint, version, resource_type, resource_name].compact.join('/')

  url = url + "?" + URI.encode_www_form(query) unless query.nil? || query.empty?
  return url
end

#to_uriObject



173
174
175
# File 'lib/puppetserver/ca/utils/http_client.rb', line 173

def to_uri
  URI(full_url)
end