Sha256: 756a31119cacb7ceb74b5df2e92de2e29bf2170459558b133bb153bb6ec9d843

Contents?: true

Size: 566 Bytes

Versions: 17

Compression:

Stored size: 566 Bytes

Contents

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

17 entries across 17 versions & 1 rubygems

Version Path
http-0.9.9 lib/http/uri.rb
http-1.0.2 lib/http/uri.rb
http-1.0.1 lib/http/uri.rb
http-1.0.0 lib/http/uri.rb
http-1.0.0.pre6 lib/http/uri.rb
http-1.0.0.pre5 lib/http/uri.rb
http-1.0.0.pre4 lib/http/uri.rb
http-1.0.0.pre3 lib/http/uri.rb
http-1.0.0.pre2 lib/http/uri.rb
http-1.0.0.pre1 lib/http/uri.rb
http-0.9.8 lib/http/uri.rb
http-0.9.7 lib/http/uri.rb
http-0.9.6 lib/http/uri.rb
http-0.9.5 lib/http/uri.rb
http-0.9.4 lib/http/uri.rb
http-0.9.3 lib/http/uri.rb
http-0.8.14 lib/http/uri.rb