Class: Uniword::Ooxml::Types::UnsignedDecimalNumber
- Inherits:
-
Lutaml::Model::Type::Integer
- Object
- Lutaml::Model::Type::Integer
- Uniword::Ooxml::Types::UnsignedDecimalNumber
- Defined in:
- lib/uniword/ooxml/types/unsigned_decimal_number.rb
Overview
ST_UnsignedDecimalNumber (ECMA-376): non-negative integer
Constrained integer type shared by unsigned OOXML measures (ST_TwipsMeasure, ST_PointMeasure, ST_PixelsMeasure). Negative values raise Lutaml::Model::Type::MinBoundError at cast time (attribute assignment and XML parsing).
Class Method Summary collapse
-
.cast(value, options = {}) ⇒ Integer?
Cast a value to a non-negative Integer.
Class Method Details
.cast(value, options = {}) ⇒ Integer?
Cast a value to a non-negative Integer
21 22 23 24 25 26 |
# File 'lib/uniword/ooxml/types/unsigned_decimal_number.rb', line 21 def self.cast(value, = {}) casted = super return casted unless casted.is_a?(::Integer) && casted.negative? raise Lutaml::Model::Type::MinBoundError.new(casted, 0) end |