class HTTP::URI
def initialize(options_or_uri = {})
-
(HTTP::URI)
- new URI instance
Options Hash:
(**options_or_uri)
-
:fragment
(String, #to_str
) -- component at the end of the URI -
:query
(String, #to_str
) -- component distinct from path -
:path
(String, #to_str
) -- component to request -
:port
(String, #to_str
) -- network port to connect to -
:host
(String, #to_str
) -- name component -
:password
(String, #to_str
) -- for basic authentication -
:user
(String, #to_str
) -- for basic authentication -
:scheme
(String, #to_str
) -- URI scheme
Parameters:
-
options_or_uri
(Hash, Addressable::URI
) --
def initialize(options_or_uri = {}) case options_or_uri when Hash @uri = Addressable::URI.new(options_or_uri) when Addressable::URI @uri = options_or_uri else raise TypeError, "expected Hash for options, got #{options_or_uri.class}" end end