class PactBroker::Api::Contracts::BaseContract

Public Class Methods

call(params) click to toggle source

The entry method for all the Dry::Validation::Contract classes eg. MyContract.call(params) It takes the params (doesn’t matter if they’re string or symbol keys) executes the dry-validation validation, and formats the errors into the Pactflow format.

@param [Hash] the parameters to validate @return [Hash] the validation errors to display to the user

# File lib/pact_broker/api/contracts/base_contract.rb, line 24
def self.call(params)
  params_to_validate = params.respond_to?(:symbolize_keys) ? params.symbolize_keys : params
  new.call(params_to_validate)
end