Module: StubRequests::URI::Suffix

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

Overview

Module Suffix deals with validating StubRequests::URI suffix

Since:

  • 0.1.0

Constant Summary collapse

PORT_REGEX =

Returns a pattern used for matching HTTP(S) ports

Returns:

  • (RegExp)

    a pattern used for matching HTTP(S) ports

Since:

  • 0.1.0

%r{:(\d+)/}.freeze

Class Method Summary collapse

Class Method Details

.valid?(host) ⇒ true, false

Checks if the host has a valid suffix

Parameters:

  • host (String)

    a string to check

Returns:

  • (true, false)

Since:

  • 0.1.0



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

def self.valid?(host)
  PublicSuffix.valid?(host, default_rule: nil)
end