Results for: "uri"

Returns scope.

Setter for scope val.

Returns filter.

Setter for filter val.

Returns extensions.

Setter for extensions val.

Checks if URI has a path. For URI::LDAP this will return false.

Description

Creates a new URI::MailTo object from components, with syntax checking.

Components can be provided as an Array or Hash. If an Array is used, the components must be supplied as [to, headers].

If a Hash is used, the keys are the component names preceded by colons.

The headers can be supplied as a pre-encoded string, such as "subject=subscribe&cc=address", or as an Array of Arrays like [['subject', 'subscribe'], ['cc', 'address']].

Examples:

require 'uri'

m1 = URI::MailTo.build(['joe@example.com', 'subject=Ruby'])
m1.to_s  # => "mailto:joe@example.com?subject=Ruby"

m2 = URI::MailTo.build(['john@example.com', [['Subject', 'Ruby'], ['Cc', 'jack@example.com']]])
m2.to_s  # => "mailto:john@example.com?Subject=Ruby&Cc=jack@example.com"

m3 = URI::MailTo.build({:to => 'listman@example.com', :headers => [['subject', 'subscribe']]})
m3.to_s  # => "mailto:listman@example.com?subject=subscribe"

Description

Creates a new URI::MailTo object from generic URL components with no syntax checking.

This method is usually called from URI::parse, which checks the validity of each component.

Setter for to v.

Setter for headers v.

Synopsis

URI::Parser.new([opts])

Args

The constructor accepts a hash as options for parser. Keys of options are pattern names of URI components and values of options are pattern strings. The constructor generates set of regexps for parsing URIs.

You can use the following keys:

* :ESCAPED (URI::PATTERN::ESCAPED in default)
* :UNRESERVED (URI::PATTERN::UNRESERVED in default)
* :DOMLABEL (URI::PATTERN::DOMLABEL in default)
* :TOPLABEL (URI::PATTERN::TOPLABEL in default)
* :HOSTNAME (URI::PATTERN::HOSTNAME in default)

Examples

p = URI::Parser.new(:ESCAPED => "(?:%[a-fA-F0-9]{2}|%u[a-fA-F0-9]{4})")
u = p.parse("http://example.jp/%uABCD") #=> #<URI::HTTP http://example.jp/%uABCD>
URI.parse(u.to_s) #=> raises URI::InvalidURIError

s = "http://example.com/ABCD"
u1 = p.parse(s) #=> #<URI::HTTP http://example.com/ABCD>
u2 = URI.parse(s) #=> #<URI::HTTP http://example.com/ABCD>
u1 == u2 #=> true
u1.eql?(u2) #=> false

Returns a split URI against regexp.

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

p = URI::Parser.new
p.parse("ldap://ldap.example.com/dc=example?user=john")
#=> #<URI::LDAP ldap://ldap.example.com/dc=example?user=john>

Args

uris

an Array of Strings

Description

Attempts to parse and merge a set of URIs.

Args

str

String to search

schemes

Patterns to apply to str

Description

Attempts to parse and merge a set of URIs. If no block given, then returns the result, else it calls block for each element in result.

See also URI::Parser.make_regexp.

Args

str

String to make safe

unsafe

Regexp to apply. Defaults to self.regexp

Description

Constructs a safe String from str, removing unsafe characters, replacing them with codes.

Args

str

String to remove escapes from

escaped

Regexp to apply. Defaults to self.regexp

Description

Removes escapes from str.

No documentation available

Synopsis

URI.escape(str [, unsafe])

Args

str

String to replaces in.

unsafe

Regexp that matches all symbols that must be replaced with codes. By default uses UNSAFE. When this argument is a String, it represents a character set.

Description

Escapes the string, replacing all unsafe characters with codes.

This method is obsolete and should not be used. Instead, use CGI.escape, URI.encode_www_form or URI.encode_www_form_component depending on your specific use case.

Usage

require 'uri'

enc_uri = URI.escape("http://example.com/?a=\11\15")
# => "http://example.com/?a=%09%0D"

URI.unescape(enc_uri)
# => "http://example.com/?a=\t\r"

URI.escape("@?@!", "!?")
# => "@%3F@%21"
No documentation available

Synopsis

URI.unescape(str)

Args

str

String to unescape.

Description

This method is obsolete and should not be used. Instead, use CGI.unescape, URI.decode_www_form or URI.decode_www_form_component depending on your specific use case.

Usage

require 'uri'

enc_uri = URI.escape("http://example.com/?a=\11\15")
# => "http://example.com/?a=%09%0D"

URI.unescape(enc_uri)
# => "http://example.com/?a=\t\r"
No documentation available

Thanks, FakeWeb!

No documentation available
Search took: 3ms  ·  Total Results: 1122