Sha256: 40364c49841b74032d6d008c3a91c4a9e31aeb785b2355568bd069c8e1a50a6b

Contents?: true

Size: 336 Bytes

Versions: 2

Compression:

Stored size: 336 Bytes

Contents

module Grape
  module Validations
    class PresenceValidator < Validator
      def validate_param!(attr_name, params)
        unless params.has_key?(attr_name)
          raise Grape::Exceptions::ValidationError, :status => 400, :param => attr_name, :message => "missing parameter: #{attr_name}"
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
grape-0.2.4 lib/grape/validations/presence.rb
grape-0.2.3 lib/grape/validations/presence.rb