Module: ActiveModel::Validations::Clusivity

Includes:
ResolveValue
Included in:
ExclusionValidator, InclusionValidator
Defined in:
activemodel/lib/active_model/validations/clusivity.rb

Overview

:nodoc:

Constant Summary collapse

ERROR_MESSAGE =
"An object with the method #include? or a proc, lambda or symbol is required, " \
"and must be supplied as the :in (or :within) option of the configuration hash"

Instance Method Summary collapse

Methods included from ResolveValue

#resolve_value

Instance Method Details

#check_validity!Object



14
15
16
17
18
# File 'activemodel/lib/active_model/validations/clusivity.rb', line 14

def check_validity!
  unless delimiter.respond_to?(:include?) || delimiter.respond_to?(:call) || delimiter.respond_to?(:to_sym)
    raise ArgumentError, ERROR_MESSAGE
  end
end