Skip to content
instance method

URI::Generic#hierarchical?

() -> bool
hierarchical?

Returns true if URI is hierarchical.

Description

URI has components listed in order of decreasing significance from left to right, see RFC3986 www.rfc-editor.org/rfc/rfc3986 1.2.3.

Usage

Example
require 'uri'

uri = URI.parse("http://my.example.com/")
uri.hierarchical?
#=> true
uri = URI.parse("mailto:[email protected]")
uri.hierarchical?
#=> false
See also #hash #host= #fragment= #hostname also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0