Sha256: 579e3c2c8739003d2fe48aff91aff6a9f59dd50a4162269e8ce17b1e706d925a

Contents?: true

Size: 561 Bytes

Versions: 1

Compression:

Stored size: 561 Bytes

Contents

module Spira::Types

  ##
  # A {Spira::Type} for gYear.  Values will be associated with the
  # `XSD.gYear` type.
  #
  # A {Spira::Resource} property can reference this type as
  # `Spira::Types::GYear`, `GYear`, or `XSD.gYear`.
  #
  # @see Spira::Type
  # @see https://ruby-rdf.github.io/rdf/RDF/Literal.html
  class GYear
    include Spira::Type

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

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

    register_alias RDF::XSD.gYear

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
spira-3.3.0 lib/spira/types/gYear.rb