Module: StubRequests::URI::Scheme

Defined in:
lib/stub_requests/uri/scheme.rb

Overview

Module Scheme handles validation of StubRequests::URI schemes

Since:

  • 0.1.0

Constant Summary collapse

SCHEMES =

Returns a list of valid HTTP schemes

Returns:

Since:

  • 0.1.0

%w[http https].freeze

Class Method Summary collapse

Class Method Details

.valid?(scheme) ⇒ true, false

Checks if the scheme is valid

Parameters:

  • scheme (String)

    a string with the URI scheme to check

Returns:

  • (true, false)

Since:

  • 0.1.0



31
32
33
# File 'lib/stub_requests/uri/scheme.rb', line 31

def self.valid?(scheme)
  SCHEMES.include?(scheme.to_s)
end