Sha256: defed461c7484f952cad3e58ccca42559a796bbf4a1a704dc9a28d658393904e

Contents?: true

Size: 562 Bytes

Versions: 12

Compression:

Stored size: 562 Bytes

Contents

module Spira::Types

  ##
  # A {Spira::Type} for string values.  Values will be associated with the
  # `XSD.string` type with no language code.
  #
  # A {Spira::Resource} property can reference this type as
  # `Spira::Types::String`, `String`, or `XSD.string`.
  #
  # @see Spira::Type
  # @see http://rdf.rubyforge.org/RDF/Literal.html
  class String

    include Spira::Type

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

    def self.serialize(value)
      RDF::Literal.new(value.to_s)
    end

    register_alias XSD.string

  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
spira-0.0.12 lib/spira/types/string.rb
spira-0.0.11 lib/spira/types/string.rb
spira-0.0.10 lib/spira/types/string.rb
spira-0.0.9 lib/spira/types/string.rb
spira-0.0.8 lib/spira/types/string.rb
spira-0.0.7 lib/spira/types/string.rb
spira-0.0.6 lib/spira/types/string.rb
spira-0.0.5 lib/spira/types/string.rb
spira-0.0.4 lib/spira/types/string.rb
spira-0.0.3 lib/spira/types/string.rb
spira-0.0.2 lib/spira/types/string.rb
spira-0.0.1 lib/spira/types/string.rb