module Kernel

Public Class Methods

URI(uri) click to toggle source

Returns uri converted to an URI object.

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

Private Instance Methods

URI(uri) click to toggle source

Returns uri converted to an URI object.

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