Method: Axlsx.validate_number_with_unit
- Defined in:
- lib/axlsx/util/validators.rb
.validate_number_with_unit(v) ⇒ Object
Requires that the value is a string containing a positive decimal number followed by one of the following units: "mm", "cm", "in", "pt", "pc", "pi"
129 130 131 |
# File 'lib/axlsx/util/validators.rb', line 129 def self.validate_number_with_unit(v) RegexValidator.validate "number_with_unit", /\A[0-9]+(\.[0-9]+)?(mm|cm|in|pt|pc|pi)\Z/, v end |