Sha256: 00bb9a367e393a4c5df699d5c408aa7b155dc68bfed3183c227d4e86fb6adee4
Contents?: true
Size: 634 Bytes
Versions: 57
Compression:
Stored size: 634 Bytes
Contents
require 'dry-validation' module PactBroker module Api module Contracts class CanIDeployQuerySchema SCHEMA = Dry::Validation.Schema do required(:pacticipant).filled(:str?) required(:version).filled(:str?) optional(:to).filled(:str?) end def self.call(params) select_first_message(SCHEMA.call(params).messages(full: true)) end def self.select_first_message(messages) messages.each_with_object({}) do | (key, value), new_messages | new_messages[key] = [value.first] end end end end end end
Version data entries
57 entries across 57 versions & 1 rubygems