Class: Axlsx::RegexValidator
- Inherits:
-
Object
- Object
- Axlsx::RegexValidator
- Defined in:
- lib/axlsx/util/validators.rb
Overview
Validates the value against the regular expression provided.
Class Method Summary collapse
Class Method Details
.validate(name, regex, v) ⇒ Object
40 41 42 |
# 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 |