Sha256: c08af2dd8b13df1ae8a68e15aded17bea7e83a66d524901205c5f08df7c18d31

Contents?: true

Size: 209 Bytes

Versions: 2

Compression:

Stored size: 209 Bytes

Contents

class HostNameValidator < ActiveModel::EachValidator
  def validate_each(record, attribute, value)
    record.errors.add(attribute, :invalid, options) unless ValidatesHost::HostName.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/host_name_validator.rb
validates_host-1.0.0 lib/validates_host/host_name_validator.rb