module ActionDispatch::Http::URL

def normalize_protocol(protocol)

Experimental RBS support (using type sampling data from the type_fusion project).

def normalize_protocol: (nil protocol) -> String

This signature was generated using 1 sample from 1 application.

def normalize_protocol(protocol)
  case protocol
  when nil
    secure_protocol ? "https://" : "http://"
  when false, "//"
    "//"
  when PROTOCOL_REGEXP
    "#{$1}://"
  else
    raise ArgumentError, "Invalid :protocol option: #{protocol.inspect}"
  end
end