Methods
C
V
Instance Public methods
check_validity!()
# File activemodel/lib/active_model/validations/format.rb, line 16
def check_validity!
  unless options.include?(:with) ^ options.include?(:without)  # ^ == xor, or "exclusive or"
    raise ArgumentError, "Either :with or :without must be supplied (but not both)"
  end

  check_options_validity(options, :with)
  check_options_validity(options, :without)
end
validate_each(record, attribute, value)
# File activemodel/lib/active_model/validations/format.rb, line 6
def validate_each(record, attribute, value)
  if options[:with]
    regexp = option_call(record, :with)
    record_error(record, attribute, :with, value) if value.to_s !~ regexp
  elsif options[:without]
    regexp = option_call(record, :without)
    record_error(record, attribute, :without, value) if value.to_s =~ regexp
  end
end