Sha256: ddae5d53afc6fe9910c93171d8de635d030c0c3554fd5db34625b42e801ad4b8
Contents?: true
Size: 595 Bytes
Versions: 64
Compression:
Stored size: 595 Bytes
Contents
require 'reform' require 'reform/contract' require 'net/http' module PactBroker module Api module Contracts module RequestValidations def method_is_valid http_method && !valid_method? end def valid_method? Net::HTTP.const_defined?(http_method.capitalize) end def url_is_valid url && !url_valid? end def url_valid? uri && uri.scheme && uri.host end def uri URI(url) rescue URI::InvalidURIError nil end end end end end
Version data entries
64 entries across 64 versions & 1 rubygems