Class: RDF::Literal::NonPositiveInteger
- Inherits:
-
Integer
- Object
- Integer
- RDF::Literal::NonPositiveInteger
- Defined in:
- lib/rdf/xsd/integer.rb
Overview
nonPositiveInteger is derived from integer by setting the value of maxInclusive to be 0. This results in the standard mathematical concept of the non-positive integers. The value space of nonPositiveInteger is the infinite set {...,-2,-1,0}
. The base type of nonPositiveInteger is integer.
Direct Known Subclasses
Constant Summary collapse
- DATATYPE =
RDF::XSD.nonPositiveInteger
- GRAMMAR =
/^(?:[\+\-]?0)|(?:-\d+)$/.freeze
Instance Method Summary collapse
-
#-@ ⇒ RDF::Literal::Numeric
Returns
self
negated. - #valid? ⇒ Boolean
Instance Method Details
#-@ ⇒ RDF::Literal::Numeric
Returns self
negated.
17 18 19 20 21 22 |
# File 'lib/rdf/xsd/integer.rb', line 17 def -@ if object != 0 # XXX Raise error? end super end |
#valid? ⇒ Boolean
24 25 26 |
# File 'lib/rdf/xsd/integer.rb', line 24 def valid? super && @object <= 0 end |