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