Module: Kernel (Ruby 2.3.4)

Kernel

Public Class Methods

URI(uri)

Returns uri converted to a URI object.

 
               # File uri/common.rb, line 710
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