Class: Spira::Types::Date

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

Overview

A Spira::Type for dates. Values will be associated with the XSD.date type.

A Resource property can reference this type as Spira::Types::Date, Date, or XSD.date.

Class Method Summary collapse

Class Method Details

.serialize(value) ⇒ Object



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

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

.unserialize(value) ⇒ Object



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

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