Sha256: 060b23d657af71c1f9e8a4c6248ec7de5becd5b0cb46f3a5efd32376a2fd626d

Contents?: true

Size: 543 Bytes

Versions: 1

Compression:

Stored size: 543 Bytes

Contents

module Spira::Types

  ##
  # A {Spira::Type} for dates.  Values will be associated with the
  # `XSD.date` type.
  #
  # A {Spira::Resource} property can reference this type as
  # `Spira::Types::Date`, `Date`, or `XSD.date`.
  #
  # @see Spira::Type
  # @see http://rdf.rubyforge.org/RDF/Literal.html
  class Date
    include Spira::Type

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

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

    register_alias RDF::XSD.date

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
spira-3.1.1 lib/spira/types/date.rb