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



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

def http?
  HTTP_SCHEME == scheme
end

#https?True, False

Returns:

  • (True)

    if URI is HTTPS

  • (False)

    otherwise



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

def https?
  HTTPS_SCHEME == scheme
end

#inspectString

Returns human-readable representation of URI.

Returns:

  • (String)

    human-readable representation of URI



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

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