Sha256: 7c1bced96d397c0200f94c94e982a0695187b21e4308ec5a22c1e8590f0f4003

Contents?: true

Size: 541 Bytes

Versions: 10

Compression:

Stored size: 541 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 XSD.date

  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
spira-3.1.0 lib/spira/types/date.rb
spira-3.0.0 lib/spira/types/date.rb
spira-2.1.0 lib/spira/types/date.rb
spira-2.0.2 lib/spira/types/date.rb
spira-2.0.1 lib/spira/types/date.rb
spira-2.0.0 lib/spira/types/date.rb
spira-1.1.1 lib/spira/types/date.rb
spira-0.7.1 lib/spira/types/date.rb
spira-0.7 lib/spira/types/date.rb
spira-0.5.0 lib/spira/types/date.rb