class ParamsChecker::ParamChecker::HashParamChecker

Public Instance Methods

call() click to toggle source
# File lib/params_checker/param_checker.rb, line 126
def call
  return nil if schema[key][:allow_nil] && params[key].nil?

  check_type && params[key]
end
check_type() click to toggle source
# File lib/params_checker/param_checker.rb, line 132
def check_type
  valid = params[key].is_a? Hash
  add_field_error("This field's type must be hash.") unless valid
  valid
end