123456789_123456789_123456789_123456789_123456789_

Module: Kernel

Relationships & Source Files
Defined in: lib/uri/common.rb

Overview

module .URI

Class Method Summary

Class Method Details

URI(uri) (mod_func)

Returns uri converted to an URI object.

[ GitHub ]

  
# File 'lib/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