diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/axlsx/util/validators.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/axlsx/util/validators.rb b/lib/axlsx/util/validators.rb index 5dc1f66e..48f99877 100644 --- a/lib/axlsx/util/validators.rb +++ b/lib/axlsx/util/validators.rb @@ -20,7 +20,7 @@ module Axlsx # @param [Regexp] regex The regular expression to evaluate # @param [Any] v The value to validate. def self.validate(name, regex, v) - raise ArgumentError, (ERR_REGEX % [v.inspect, regex.to_s]) unless (v.respond_to?(:=~) && v =~ regex) + raise ArgumentError, (ERR_REGEX % [v.inspect, regex.to_s]) unless (v.respond_to?(:to_s) && v.to_s.match(regex)) end end # Validate that the class of the value provided is either an instance or the class of the allowed types and that any specified additional validation returns true. |
