Class: Seahorse::ParamValidator Private
- Inherits:
-
Object
- Object
- Seahorse::ParamValidator
- Defined in:
- lib/seahorse/param_validator.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Class Method Summary collapse
-
.validate!(rules, params) ⇒ Boolean
private
Returns ‘true` when params are valid.
Instance Method Summary collapse
-
#initialize(rules) ⇒ ParamValidator
constructor
private
A new instance of ParamValidator.
-
#validate!(params) ⇒ Boolean
private
Returns ‘true` if the `params` are valid.
Constructor Details
#initialize(rules) ⇒ ParamValidator
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of ParamValidator.
23 24 25 |
# File 'lib/seahorse/param_validator.rb', line 23 def initialize rules @rules = (rules || {})['members'] || {} end |
Class Method Details
.validate!(rules, params) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns ‘true` when params are valid.
151 152 153 |
# File 'lib/seahorse/param_validator.rb', line 151 def validate! rules, params ParamValidator.new(rules).validate!(params) end |
Instance Method Details
#validate!(params) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns ‘true` if the `params` are valid.
31 32 33 34 |
# File 'lib/seahorse/param_validator.rb', line 31 def validate! params validate_structure(@rules, params || {}) true end |