Sha256: c5015c3aa85b4c888d8804574318ac23c856edb7a2798037cc4f30ce4ae24b35
Contents?: true
Size: 349 Bytes
Versions: 41
Compression:
Stored size: 349 Bytes
Contents
# frozen_string_literal: true class MiniDefender::Rules::AlphaNum < MiniDefender::Rule def self.signature 'alpha_num' end def passes?(attribute, value, validator) value.is_a?(String) && /^[a-zA-Z0-9]+$/.match?(value) end def message(attribute, value, validator) 'The field must only contain alpha-num characters.' end end
Version data entries
41 entries across 41 versions & 1 rubygems