Sha256: 60f63dc018c4a53ec60998b3948ad824bed5ee3b70fb009a48b15c2ee20651fa

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 AtLeastOneOfValidator < MultipleParamsBase
      def validate_params!(params)
        return unless keys_in_common(params).empty?
        raise Grape::Exceptions::Validation, params: all_keys, message: message(:at_least_one)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
grape-extra_validators-2.0.0 vendor/bundle/ruby/2.6.0/gems/grape-1.2.5/lib/grape/validations/validators/at_least_one_of.rb
grape-extra_validators-1.0.0 vendor/bundle/ruby/2.4.0/gems/grape-1.2.5/lib/grape/validations/validators/at_least_one_of.rb
grape-1.2.5 lib/grape/validations/validators/at_least_one_of.rb