Sha256: b4f61c7f62b6508322c6581df7ad11bc2f1f22adc9210f91160c2233ec5e2b82

Contents?: true

Size: 635 Bytes

Versions: 1

Compression:

Stored size: 635 Bytes

Contents

module Spira::Types

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

    include Spira::Type

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

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

    register_alias RDF::XSD.positiveInteger

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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