Sha256: e4441c621ca923febc84754c2f7c71f0c791b38f697d2df79ae55fbf47b497f0
Contents?: true
Size: 423 Bytes
Versions: 16
Compression:
Stored size: 423 Bytes
Contents
module CLIUtils # A Validator to verify whether a Pref answer # is alphabetic (made up of letters and spaces). class AlphabeticValidator < PrefValidator # Runs the Validator against the answer. # @param [Object] text The "text" to evaluate # @return [String] def validate(text) @is_valid = text.to_s =~ /\A[A-Za-z\s]+\z/ @message = "Response is not alphabetic: #{ text }" end end end
Version data entries
16 entries across 16 versions & 1 rubygems