| Class | Grape::Validations::Base |
| In: |
lib/grape/validations/validators/base.rb
|
| Parent: | Object |
| attrs | [R] |
Creates a new Validator from options specified by a requires or optional directive during parameter definition. @param attrs [Array] names of attributes to which the Validator applies @param options [Object] implementation-dependent Validator options @param required [Boolean] attribute(s) are required or optional @param scope [ParamsScope] parent scope for this Validator @param opts [Hash] additional validation options
Validates a given request. @note Override validate! unless you need to access the entire request. @param request [Grape::Request] the request currently being handled @raise [Grape::Exceptions::Validation] if validation failed @return [void]
Validates a given parameter hash. @note Override validate if you need to access the entire request. @param params [Hash] parameters to validate @raise [Grape::Exceptions::Validation] if validation failed @return [void]