Sha256: b9fee511729d5ce75f899b062daef4e22afd8939995ade16b66e5293ccc93600
Contents?: true
Size: 255 Bytes
Versions: 11
Compression:
Stored size: 255 Bytes
Contents
module ActiveModel module Validations class HexColorValidator < EachValidator def validate_each(record, attribute, value) unless value =~ /\A(\h{3}){,2}\z/ record.errors.add(attribute) end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems