Sha256: cb76c9947f978d686981b7406f23abaadb6393b40d1c2c51a85d5064838977fb

Contents?: true

Size: 317 Bytes

Versions: 6

Compression:

Stored size: 317 Bytes

Contents

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

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
fragrant-0.0.5 vendor/bundle/ruby/1.9.1/gems/grape-0.2.2/lib/grape/validations/presence.rb
fragrant-0.0.4 vendor/grape/lib/grape/validations/presence.rb
grape-0.2.2 lib/grape/validations/presence.rb
fragrant-0.0.3 vendor/grape/lib/grape/validations/presence.rb
fragrant-0.0.2 vendor/grape/lib/grape/validations/presence.rb
fragrant-0.0.1 vendor/grape/lib/grape/validations/presence.rb