diff options
| author | Randy Morgan <[email protected]> | 2012-02-13 22:28:58 +0900 |
|---|---|---|
| committer | Randy Morgan <[email protected]> | 2012-02-13 22:28:58 +0900 |
| commit | 80459ca70930ee8522b8547669bbbe7aef5a12a4 (patch) | |
| tree | dc5495352ba3e3b5dbb2c977e32c55f371397ab3 /lib/axlsx/util/validators.rb | |
| parent | a78481741fa7b6bf999461a12cc5c9dce026ea49 (diff) | |
| download | caxlsx-80459ca70930ee8522b8547669bbbe7aef5a12a4.tar.gz caxlsx-80459ca70930ee8522b8547669bbbe7aef5a12a4.zip | |
Improve accessibility and stringency for column_widths editing.
Diffstat (limited to 'lib/axlsx/util/validators.rb')
| -rw-r--r-- | lib/axlsx/util/validators.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/axlsx/util/validators.rb b/lib/axlsx/util/validators.rb index 9accd3db..ce810e54 100644 --- a/lib/axlsx/util/validators.rb +++ b/lib/axlsx/util/validators.rb @@ -53,6 +53,14 @@ module Axlsx DataTypeValidator.validate(:unsigned_int, [Fixnum, Integer], v, lambda { |arg| arg.respond_to?(:>=) && arg >= 0 }) end + # Requires that the value is a Fixnum Integer or Float and is greater or equal to 0 + # @param [Any] v The value validated + # @raise [ArgumentError] raised if the value is not a Fixnum or Integer value greater or equal to 0 + # @return [Boolean] true if the data is valid + def self.validate_unsigned_numeric(v) + DataTypeValidator.validate("Invalid column width", [Fixnum, Integer, Float], v, lambda { |arg| arg.respond_to?(:>=) && arg >= 0 }) + end + # Requires that the value is a Fixnum or Integer # @param [Any] v The value validated def self.validate_int(v) |
