Sha256: 5d8a01ee66cad7078ce02884e21ae22b3c6af4554b8db8f41b2abe3dfe4f6a2d
Contents?: true
Size: 417 Bytes
Versions: 10
Compression:
Stored size: 417 Bytes
Contents
# frozen_string_literal: true 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.new(params: keys, message: message(:mutual_exclusion)) end end end end
Version data entries
10 entries across 10 versions & 2 rubygems