Sha256: 6a020ed8691d0b1bc5d4430bbae9257a0df312a4a015864f28def97a85fe8009

Contents?: true

Size: 241 Bytes

Versions: 1

Compression:

Stored size: 241 Bytes

Contents

# frozen_string_literal: true

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

1 entries across 1 versions & 1 rubygems

Version Path
validates_host-1.2.0 lib/validates_host/host_name_validator.rb