Sha256: 2983304f25ed3c111c3b594083ceaf2fe5732d9b9d39d76878e63dcfecdee15c
Contents?: true
Size: 441 Bytes
Versions: 1
Compression:
Stored size: 441 Bytes
Contents
# frozen_string_literal: true class IpValidator < ActiveModel::EachValidator def validate_each(record, attribute, value) return if ValidatesHost::Ip.new(value).valid? ruby_prior_version_three = Gem::Version.new(RUBY_VERSION) < Gem::Version.new('3.0.0') if ruby_prior_version_three record.errors.add(attribute, :invalid, options) else record.errors.add(attribute, :invalid, **options) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
validates_host-1.3.0 | lib/validates_host/ip_validator.rb |