Class: Spira::Types::DateTime

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

Overview

A Spira::Type for dateTimes. Values will be associated with the XSD.dateTime type.

A Resource property can reference this type as Spira::Types::DateTime, DateTime, or XSD.dateTime.

Class Method Summary collapse

Class Method Details

.serialize(value) ⇒ Object



19
20
21
# File 'lib/spira/types/dateTime.rb', line 19

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

.unserialize(value) ⇒ Object



15
16
17
# File 'lib/spira/types/dateTime.rb', line 15

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