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