class WeakParameters::HashValidator

Private Instance Methods

error_message() click to toggle source
# File lib/weak_parameters/hash_validator.rb, line 14
def error_message
  "params[#{key.inspect}] must be a valid Hash"
end
valid_type?() click to toggle source
# File lib/weak_parameters/hash_validator.rb, line 5
def valid_type?
  type = if Object.const_defined?(:ActionController) && ActionController.const_defined?(:StrongParameters)
           ActionController::Parameters
         else
           Hash
         end
  value.is_a?(type)
end