Module: ParamsSanitizer::Sanitizers::ExistValue::SanitizerMethods
- Defined in:
- lib/params_sanitizer/sanitizers/exist_value.rb
Instance Method Summary collapse
-
#exist_value(key, default_value, min = nil, max = nil) ⇒ Object
Define rule of exist_value.
Instance Method Details
#exist_value(key, default_value, min = nil, max = nil) ⇒ Object
Define rule of exist_value
25 26 27 28 29 |
# File 'lib/params_sanitizer/sanitizers/exist_value.rb', line 25 def exist_value(key, default_value, min = nil, max = nil) check_duplicated_definition!(key) definitions[:exist_value] ||= Hash.new definitions[:exist_value][key.to_s] = { default_value: default_value } end |