module Kernel

def URI(uri)


# => #
URI(uri)
# Returns the given URI.
# => #
uri = URI('http://github.com/ruby/ruby')
# Returns a new URI.

which may be a \URI string or an existing \URI object:
Returns a \URI object derived from the given +uri+,
def URI(uri)
  if uri.is_a?(URI::Generic)
    uri
  elsif uri = String.try_convert(uri)
    URI.parse(uri)
  else
    raise ArgumentError,
      "bad argument (expected URI object or URI string)"
  end
end