Skip to content

Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →

instance method

URI::RFC2396_Parser#parse

(::String uri) -> ::URI::Generic
parse(uri)

Args

uri

String

Description

Parses uri and constructs either matching URI scheme object (File, FTP, HTTP, HTTPS, LDAP, LDAPS, or MailTo) or URI::Generic.

Usage

Example
p = URI::Parser.new
p.parse("ldap://ldap.example.com/dc=example?user=john")
#=> #<URI::LDAP ldap://ldap.example.com/dc=example?user=john>
See also #make_regexp #split #join #unescape also in 4.1 · 4.0 · 3.3 · 3.2 · 3.1 · 3.0