Class: HTTP::URI

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

Constant Summary collapse

HTTP_SCHEME =

HTTP scheme

"http".freeze
HTTPS_SCHEME =

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