Sha256: 5b4c6199f4d9c9ac9aa6fd56003b5dafad732589d57dbb6de833f9c209a7f451

Contents?: true

Size: 761 Bytes

Versions: 10

Compression:

Stored size: 761 Bytes

Contents

# frozen_string_literal: true

#
# Abstraction over WebMock to reduce duplication
#
# @author Mikael Henriksson <mikael@zoolutions.se>
# @since 0.1.0
#
module StubRequests
  #
  # Module URI organizes all gem logic regarding URI
  #
  # @author Mikael Henriksson <mikael@zoolutions.se>
  #
  module URI
    #
    # Module Scheme handles validation of {URI} schemes
    #
    module Scheme
      #
      # @return [Array<String>] a list of valid HTTP schemes
      SCHEMES = %w[http https].freeze

      #
      # Checks if the scheme is valid
      #
      # @param [String] scheme a string with the URI scheme to check
      #
      # @return [true,false]
      #
      def self.valid?(scheme)
        SCHEMES.include?(scheme.to_s)
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
stub_requests-0.1.11 lib/stub_requests/uri/scheme.rb
stub_requests-0.1.10 lib/stub_requests/uri/scheme.rb
stub_requests-0.1.9 lib/stub_requests/uri/scheme.rb
stub_requests-0.1.8 lib/stub_requests/uri/scheme.rb
stub_requests-0.1.7 lib/stub_requests/uri/scheme.rb
stub_requests-0.1.6 lib/stub_requests/uri/scheme.rb
stub_requests-0.1.5 lib/stub_requests/uri/scheme.rb
stub_requests-0.1.4 lib/stub_requests/uri/scheme.rb
stub_requests-0.1.3 lib/stub_requests/uri/scheme.rb
stub_requests-0.1.2 lib/stub_requests/uri/scheme.rb