Sha256: 401a894c1ca5f4a3e6570e684b39c2a6a0f7e37f6fc8ea53633d70bab1932bcc

Contents?: true

Size: 197 Bytes

Versions: 2

Compression:

Stored size: 197 Bytes

Contents

class IpValidator < ActiveModel::EachValidator
  def validate_each(record, attribute, value)
    record.errors.add(attribute, :invalid, options) unless ValidatesHost::Ip.new(value).valid?
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
validates_host-1.1.0 lib/validates_host/ip_validator.rb
validates_host-1.0.0 lib/validates_host/ip_validator.rb