Class: Grape::Validations::MultipleParamsBase
- Defined in:
- lib/grape/validations/validators/multiple_params_base.rb
Direct Known Subclasses
AllOrNoneOfValidator, AtLeastOneOfValidator, MutualExclusionValidator
Instance Attribute Summary collapse
-
#scoped_params ⇒ Object
readonly
Returns the value of attribute scoped_params.
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
convert_to_short_name, inherited, #initialize
Constructor Details
This class inherits a constructor from Grape::Validations::Base
Instance Attribute Details
#scoped_params ⇒ Object (readonly)
Returns the value of attribute scoped_params.
4 5 6 |
# File 'lib/grape/validations/validators/multiple_params_base.rb', line 4 def scoped_params @scoped_params end |
Instance Method Details
#validate!(params) ⇒ Object
6 7 8 9 |
# File 'lib/grape/validations/validators/multiple_params_base.rb', line 6 def validate!(params) @scoped_params = [@scope.params(params)].flatten params end |