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