Module: Kernel (Ruby 2.2.4)
Description: Module : Kernel - Ruby 2.2.4

- Home
- Core 2.2.4
- Std-lib 2.2.4
- Downloads

Support for the Ruby 2.2 series has ended. See here for reference.

### Home Classes Methods

### In Files

- uri/common.rb

### Methods

- ::URI

### Class/Module Index

Quicksearch

- Kernel
- URI
- URI::BadURIError
- URI::Error
- URI::Escape
- URI::FTP
- URI::Generic
- URI::HTTP
- URI::HTTPS
- URI::InvalidComponentError
- URI::InvalidURIError
- URI::LDAP
- URI::LDAPS
- URI::MailTo
- URI::REGEXP
- URI::RFC2396_Parser
- URI::RFC2396_REGEXP
- URI::RFC2396_REGEXP::PATTERN

No matching classes.

# Kernel

### Public Class Methods

URI(uri) click to toggle source

Returns `uri` converted to a URI object.

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