Class: Spira::Types::NonNegativeInteger

Inherits:
Object
  • Object
show all
Includes:
Spira::Type
Defined in:
lib/spira/types/nonNegativeInteger.rb

Overview

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

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

Class Method Summary collapse

Class Method Details

.serialize(value) ⇒ Object



20
21
22
# File 'lib/spira/types/nonNegativeInteger.rb', line 20

def self.serialize(value)
  RDF::Literal.new(value, datatype: XSD.nonNegativeInteger)
end

.unserialize(value) ⇒ Object



16
17
18
# File 'lib/spira/types/nonNegativeInteger.rb', line 16

def self.unserialize(value)
  value.object.to_i
end