Sha256: 69ac777f65cd777e14e1d468183c470967980ca0bb11fa0367ece3be79c23edf

Contents?: true

Size: 659 Bytes

Versions: 1

Compression:

Stored size: 659 Bytes

Contents

module Spira::Types

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

    include Spira::Type

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

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

    register_alias RDF::XSD.nonPositiveInteger

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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