summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/util/validators.rb
diff options
context:
space:
mode:
authorGeremia Taglialatela <[email protected]>2023-05-23 17:50:23 +0200
committerGeremia Taglialatela <[email protected]>2023-05-23 17:50:23 +0200
commit950bd404904321ba5d12b55b144ad6a1e6a5354e (patch)
tree2d45af03a0e1ce6c43f1470260bf21c89aa3c0f9 /lib/axlsx/util/validators.rb
parent28b8b1a72affbab9ca81eb7629e9557adca372f1 (diff)
downloadcaxlsx-950bd404904321ba5d12b55b144ad6a1e6a5354e.tar.gz
caxlsx-950bd404904321ba5d12b55b144ad6a1e6a5354e.zip
Improve Regexp validator
Replace `.match` with `.match?`
Diffstat (limited to 'lib/axlsx/util/validators.rb')
-rw-r--r--lib/axlsx/util/validators.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/axlsx/util/validators.rb b/lib/axlsx/util/validators.rb
index 72e3f2d8..695d28ad 100644
--- a/lib/axlsx/util/validators.rb
+++ b/lib/axlsx/util/validators.rb
@@ -41,7 +41,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?(:to_s) && v.to_s.match(regex))
+ raise ArgumentError, (ERR_REGEX % [v.inspect, regex.to_s]) unless (v.respond_to?(:to_s) && regex.match?(v.to_s))
end
end