Sha256: a40504e3acdb5e4f842b3da46c9ed80422bb1aef43deef129a73f2e7e5e0731e

Contents?: true

Size: 436 Bytes

Versions: 1

Compression:

Stored size: 436 Bytes

Contents

# frozen_string_literal: true

require 'grape/validations/validators/multiple_params_base'

module Grape
  module Validations
    module Validators
      class AtLeastOneOfValidator < MultipleParamsBase
        def validate_params!(params)
          return unless keys_in_common(params).empty?

          raise Grape::Exceptions::Validation.new(params: all_keys, message: message(:at_least_one))
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
grape-1.6.2 lib/grape/validations/validators/at_least_one_of.rb