Sha256: c1cf16937ba5689c062e131ddf5c7b03eae9a020b93c9ded0bd4738bfbcac100

Contents?: true

Size: 635 Bytes

Versions: 1

Compression:

Stored size: 635 Bytes

Contents

module Spira::Types

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

    include Spira::Type

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

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

    register_alias RDF::XSD.negativeInteger

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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