Sha256: 41da9c1bdc8db5fd8d25464a2c1d83ddbf6172c070356d403d540e784e964585
Contents?: true
Size: 382 Bytes
Versions: 3
Compression:
Stored size: 382 Bytes
Contents
require 'grape/validations/validators/multiple_params_base' module Grape module Validations class MutualExclusionValidator < MultipleParamsBase def validate_params!(params) keys = keys_in_common(params) return if keys.length <= 1 raise Grape::Exceptions::Validation, params: keys, message: message(:mutual_exclusion) end end end end
Version data entries
3 entries across 3 versions & 2 rubygems