class Addressable::URI

def origin

Returns:
  • (String) - The serialized origin.
def origin
  if self.scheme && self.authority
    if self.normalized_port
      "#{self.normalized_scheme}://#{self.normalized_host}" +
      ":#{self.normalized_port}"
    else
      "#{self.normalized_scheme}://#{self.normalized_host}"
    end
  else
    "null"
  end
end