Method: Axlsx.validate_unsigned_numeric

Defined in:
lib/axlsx/util/validators.rb

.validate_unsigned_numeric(v) ⇒ Boolean

Requires that the value is a Fixnum Integer or Float and is greater or equal to 0

Parameters:

  • v (Any)

    The value validated

Returns:

  • (Boolean)

    true if the data is valid

Raises:

  • (ArgumentError)

    raised if the value is not a Fixnun, Integer, Float value greater or equal to 0



95
96
97
# File 'lib/axlsx/util/validators.rb', line 95

def self.validate_unsigned_numeric(v)
  DataTypeValidator.validate("Invalid column width", [Fixnum, Integer, Float], v, lambda { |arg| arg.respond_to?(:>=) && arg.to_i >= 0 })
end