Class: RDF::Literal::NonNegativeInteger

Inherits:
Integer
  • Object
show all
Defined in:
lib/rdf/xsd/integer.rb

Overview

nonNegativeInteger is derived from integer by setting the value of minInclusive to be 0. This results in the standard mathematical concept of the non-negative integers. The value space of nonNegativeInteger is the infinite set [0,1,2,...]. The base type of nonNegativeInteger is integer.

Direct Known Subclasses

PositiveInteger, UnsignedLong

Constant Summary collapse

GRAMMAR =
/^(?:(?:[\+\-]?0)|(?:\+?\d+))$/.freeze
DATATYPE =
RDF::XSD.nonNegativeInteger

Instance Method Summary collapse

Instance Method Details

#valid?Boolean

Returns:

  • (Boolean)

120
121
122
# File 'lib/rdf/xsd/integer.rb', line 120

def valid?
  super && @object >= 0
end