class Spira::Types::NonNegativeInteger

A {Spira::Type} for nonnegative integer values. Values will be associated with the `XSD.nonNegativeInteger` type.

A {Spira::Resource} property can reference this type as `Spira::Types::NonNegativeInteger`, `NonNegativeInteger`, or `XSD.nonNegativeInteger`.

@see Spira::Type @see rdf.rubyforge.org/RDF/Literal.html

Public Class Methods

serialize(value) click to toggle source
# File lib/spira/types/nonNegativeInteger.rb, line 20
def self.serialize(value)
  RDF::Literal.new(value, datatype: XSD.nonNegativeInteger)
end
unserialize(value) click to toggle source
# File lib/spira/types/nonNegativeInteger.rb, line 16
def self.unserialize(value)
  value.object.to_i
end