Module: ParamsSanitizer::Sanitizers::RejectRange::SanitizerMethods
- Defined in:
- lib/params_sanitizer/sanitizers/reject_range.rb
Instance Method Summary collapse
-
#reject_range(key, default_value, min = nil, max = nil) ⇒ Object
Define rule of reject range.
Instance Method Details
#reject_range(key, default_value, min = nil, max = nil) ⇒ Object
Define rule of reject range.
49 50 51 52 53 |
# File 'lib/params_sanitizer/sanitizers/reject_range.rb', line 49 def reject_range(key, default_value, min = nil, max = nil) check_duplicated_definition!(key) definitions[:reject_range] ||= Hash.new definitions[:reject_range][key.to_s] = { default_value: default_value, min: min, max: max } end |