Sha256: dea3896f243f5efee7f1c7dccb6208d0ff4287dde2ab63569ea71741475b043e
Contents?: true
Size: 390 Bytes
Versions: 16
Compression:
Stored size: 390 Bytes
Contents
module CLIUtils # A Validator to verify whether a Pref answer # is not a number. class NumberValidator < 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[-+]?\d*\.?\d+\z/ @message = "Response is not a number: #{ text }" end end end
Version data entries
16 entries across 16 versions & 1 rubygems