| Class | Grape::Validations::ParamsScope |
| In: |
lib/grape/validations/params_scope.rb
|
| Parent: | Object |
| element | [RW] | |
| index | [RW] | |
| parent | [RW] | |
| type | [R] |
Open up a new ParamsScope, allowing parameter definitions per
Grape::DSL::Params.
@param opts [Hash] options for this scope @option opts :element [Symbol] the element that contains this scope; for
this to be relevant, @parent must be set
@option opts :parent [ParamsScope] the scope containing this scope @option opts :api [API] the API endpoint to modify @option opts :optional [Boolean] whether or not this scope needs to have
any parameters set or not
@option opts :type [Class] a type meant to govern this scope (deprecated) @option opts :type [Hash] group options for this scope @option opts :dependent_on [Symbol] if present, this scope should only
validate if this param is present in the parent scope
@yield the instance context, open for parameter definitions
A lateral scope is subordinate to its parent, but its keys are at the same level as its parent and thus is not contained within an element. @return [Boolean] whether or not this scope is lateral
A nested scope is contained in one of its parent‘s elements. @return [Boolean] whether or not this scope is nested