Class: Spira::Types::GYear

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

Overview

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

A Resource property can reference this type as Spira::Types::GYear, GYear, or XSD.gYear.

Class Method Summary collapse

Class Method Details

.serialize(value) ⇒ Object



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

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

.unserialize(value) ⇒ Object



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

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