Sha256: b1f752108b3de65b86ef927a6a4e46ef849c451c8bd1e9c187eb55b13fb368e0

Contents?: true

Size: 692 Bytes

Versions: 2

Compression:

Stored size: 692 Bytes

Contents

# frozen_string_literal: true

#
# Abstraction over WebMock to reduce duplication
#
# @author Mikael Henriksson <mikael@zoolutions.se>
# @since 0.1.0
#
module StubRequests
  #
  # Provides convenience methods for URI
  #
  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

2 entries across 2 versions & 1 rubygems

Version Path
stub_requests-0.1.1 lib/stub_requests/uri/scheme.rb
stub_requests-0.1.0 lib/stub_requests/uri/scheme.rb