class Axlsx::RegexValidator
Validates the value against the regular expression provided.
Public Class Methods
validate(name, regex, v)
click to toggle source
@param [String] name The name of what is being validated. This is included in the output when the value is invalid @param [Regexp] regex The regular expression to evaluate @param [Any] v The value to validate.
# File lib/axlsx/util/validators.rb, line 40 def self.validate(name, regex, v) raise ArgumentError, (ERR_REGEX % [v.inspect, regex.to_s]) unless (v.respond_to?(:to_s) && v.to_s.match(regex)) end