Module: ParamsSanitizer::Sanitizers::AcceptRegex::SanitizerMethods
- Defined in:
- lib/params_sanitizer/sanitizers/accept_regex.rb
Instance Method Summary collapse
-
#accept_regex(key, default_value, regex) ⇒ Object
Define rule of accept regex.
Instance Method Details
#accept_regex(key, default_value, regex) ⇒ Object
Define rule of accept regex.
45 46 47 48 49 |
# File 'lib/params_sanitizer/sanitizers/accept_regex.rb', line 45 def accept_regex(key, default_value, regex) check_duplicated_definition!(key) definitions[:accept_regex] ||= Hash.new definitions[:accept_regex][key.to_s] = { default_value: default_value, regex: regex } end |