Class: Spira::Types::Time

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

Overview

A Spira::Type for times. Values will be associated with the ‘XSD.time` type.

A Resource property can reference this type as ‘Spira::Types::Time`, `Time`, or `XSD.time`.

Class Method Summary collapse

Methods included from Spira::Type

included

Class Method Details

.serialize(value) ⇒ Object



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

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

.unserialize(value) ⇒ Object



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

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