Sha256: fafdebd1604df3e1460d7243e449d2dbd876dead770108a0638239a2bf5a361e

Contents?: true

Size: 397 Bytes

Versions: 38

Compression:

Stored size: 397 Bytes

Contents

require 'dry-validation'

module PactBroker
  module Api
    module Contracts
      module DryValidationPredicates
        include Dry::Logic::Predicates

        predicate(:date?) do |value|
          DateTime.parse(value) rescue false
        end

        predicate(:not_blank?) do | value |
          value && value.is_a?(String) && value.strip.size > 0
        end
      end
    end
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
pact_broker-2.77.0 lib/pact_broker/api/contracts/dry_validation_predicates.rb
pact_broker-2.76.2 lib/pact_broker/api/contracts/dry_validation_predicates.rb
pact_broker-2.76.1 lib/pact_broker/api/contracts/dry_validation_predicates.rb
pact_broker-2.76.0 lib/pact_broker/api/contracts/dry_validation_predicates.rb
pact_broker-2.75.0 lib/pact_broker/api/contracts/dry_validation_predicates.rb
pact_broker-2.74.1 lib/pact_broker/api/contracts/dry_validation_predicates.rb
pact_broker-2.74.0 lib/pact_broker/api/contracts/dry_validation_predicates.rb
pact_broker-2.73.0 lib/pact_broker/api/contracts/dry_validation_predicates.rb
pact_broker-2.72.0 lib/pact_broker/api/contracts/dry_validation_predicates.rb
pact_broker-2.71.0 lib/pact_broker/api/contracts/dry_validation_predicates.rb
pact_broker-2.70.0 lib/pact_broker/api/contracts/dry_validation_predicates.rb
pact_broker-2.69.0 lib/pact_broker/api/contracts/dry_validation_predicates.rb
pact_broker-2.68.1 lib/pact_broker/api/contracts/dry_validation_predicates.rb
pact_broker-2.68.0 lib/pact_broker/api/contracts/dry_validation_predicates.rb
pact_broker-2.67.0 lib/pact_broker/api/contracts/dry_validation_predicates.rb
pact_broker-2.66.0 lib/pact_broker/api/contracts/dry_validation_predicates.rb
pact_broker-2.65.0 lib/pact_broker/api/contracts/dry_validation_predicates.rb
pact_broker-2.64.0 lib/pact_broker/api/contracts/dry_validation_predicates.rb
pact_broker-2.63.0 lib/pact_broker/api/contracts/dry_validation_predicates.rb
pact_broker-2.62.0 lib/pact_broker/api/contracts/dry_validation_predicates.rb