Sha256: 70a32b0d9fa0369be00873d77aa0b4144fdab00ae3e7251138877ba8161b2fe4

Contents?: true

Size: 582 Bytes

Versions: 1

Compression:

Stored size: 582 Bytes

Contents

module Spira::Types

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

    include Spira::Type

    def self.unserialize(value)
      value.object
    end

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

    register_alias RDF::XSD.anyURI

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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