class Aquatone::UrlMaker

Constants

SSL_PORTS

Public Class Methods

make(host, port) click to toggle source
# File lib/aquatone/url_maker.rb, line 6
def self.make(host, port)
  case port
  when 80
    "http://#{host}/"
  when 443
    "https://#{host}/"
  else
    if ssl_port?(port)
      "https://#{host}:#{port}/"
    else
      "http://#{host}:#{port}/"
    end
  end
end

Private Class Methods

ssl_port?(port) click to toggle source
# File lib/aquatone/url_maker.rb, line 23
def self.ssl_port?(port)
  SSL_PORTS.include?(port.to_i)
end