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