class HTTP::URI

def initialize(options_or_uri = {})

Returns:
  • (HTTP::URI) - new URI instance

Options Hash: (**[String,)
  • #to_str (]) -- to_str] :fragment component at the end of the URI
  • #to_str (]) -- to_str] :query component distinct from path
  • #to_str (]) -- to_str] :path component to request
  • #to_str (]) -- to_str] :port network port to connect to
  • #to_str (]) -- to_str] :host name component
  • #to_str (]) -- to_str] :password for basic authentication
  • #to_str (]) -- to_str] :user for basic authentication
  • #to_str (]) -- to_str] :scheme URI scheme
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