Class: InputSanitizer::V2::NestedSanitizerFactory
- Inherits:
-
Object
- Object
- InputSanitizer::V2::NestedSanitizerFactory
- Defined in:
- lib/input_sanitizer/v2/nested_sanitizer_factory.rb
Defined Under Namespace
Classes: HashExpected, NilAllowed
Class Method Summary collapse
Class Method Details
.for(nested_sanitizer_klass, value, options) ⇒ Object
30 31 32 33 34 35 36 37 38 |
# File 'lib/input_sanitizer/v2/nested_sanitizer_factory.rb', line 30 def self.for(nested_sanitizer_klass, value, ) if value.nil? && [:allow_nil] && ![:collection] NilAllowed.new elsif !value.is_a?(Hash) HashExpected.new(value) else nested_sanitizer_klass.new(value, ) end end |