Method: Grape::Validations::Validators::Base#initialize
- Defined in:
- lib/grape/validations/validators/base.rb
#initialize(attrs, options, required, scope, opts) ⇒ Base
Creates a new Validator from options specified
by a requires or optional directive during
parameter definition.
56 57 58 59 60 61 62 63 64 |
# File 'lib/grape/validations/validators/base.rb', line 56 def initialize(attrs, , required, scope, opts) @attrs = Array(attrs).freeze = Grape::Util::DeepFreeze.deep_freeze() @option = # TODO: remove in next major release @required = required @scope = scope @fail_fast, @allow_blank = opts.values_at(:fail_fast, :allow_blank) = (self.class.) if self.class. end |