Class: HTTP::URI

Inherits:
Addressable::URI
  • Object
show all
Defined in:
lib/http/uri.rb

Constant Summary collapse

HTTP_SCHEME =
"http".freeze
HTTPS_SCHEME =
"https".freeze

Instance Method Summary collapse

Instance Method Details

#http?True, False

Returns:

  • (True)

    if URI is HTTP

  • (False)

    otherwise



14
15
16
# File 'lib/http/uri.rb', line 14

def http?
  HTTP_SCHEME == scheme
end

#https?True, False

Returns:

  • (True)

    if URI is HTTPS

  • (False)

    otherwise



20
21
22
# File 'lib/http/uri.rb', line 20

def https?
  HTTPS_SCHEME == scheme
end

#inspectString

Returns human-readable representation of URI.

Returns:

  • (String)

    human-readable representation of URI



25
26
27
# File 'lib/http/uri.rb', line 25

def inspect
  format("#<%s:%#0x URI:%s>", self.class, object_id, to_s)
end