class IpAddressValidator

Public Instance Methods

validate_each(record, attribute, value) click to toggle source
# File lib/universal_validators_rails.rb, line 20
def validate_each(record, attribute, value)
  validator = ::UniversalValidators::IpValidator.new(value, @options[:with_mask] || false)
  record.errors.add(attribute, @options[:message] || 'Invalid ip address format') unless validator.valid?
end