Sha256: 28cd9cf3c4dfeff00ff63d35c3fcb3616f7a45fdb15e5570d62be04744ddb5e9

Contents?: true

Size: 596 Bytes

Versions: 2

Compression:

Stored size: 596 Bytes

Contents

# frozen_string_literal: true
require "addressable/uri"

module HTTP
  class URI < Addressable::URI
    # @private
    HTTP_SCHEME = "http".freeze

    # @private
    HTTPS_SCHEME = "https".freeze

    # @return [True] if URI is HTTP
    # @return [False] otherwise
    def http?
      HTTP_SCHEME == scheme
    end

    # @return [True] if URI is HTTPS
    # @return [False] otherwise
    def https?
      HTTPS_SCHEME == scheme
    end

    # @return [String] human-readable representation of URI
    def inspect
      format("#<%s:%#0x URI:%s>", self.class, object_id, to_s)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
http-1.0.4 lib/http/uri.rb
http-1.0.3 lib/http/uri.rb