Class: RDF::Literal::Short

Inherits:
Int show all
Defined in:
vendor/bundler/ruby/2.7.0/bundler/gems/rdf-xsd-a2d77e29e739/lib/rdf/xsd/integer.rb

Overview

short is derived from int by setting the value of maxInclusive to be 32767 and minInclusive to be -32768. The base type of short is int.

Direct Known Subclasses

Byte

Constant Summary collapse

DATATYPE =
RDF::XSD.short

Constants inherited from Integer

Integer::GRAMMAR

Constants inherited from Decimal

Decimal::GRAMMAR

Constants inherited from RDF::Literal

FALSE, TRUE, ZERO

Constants included from N3::Terminals

N3::Terminals::ANON, N3::Terminals::BASE, N3::Terminals::BLANK_NODE_LABEL, N3::Terminals::DECIMAL, N3::Terminals::DOUBLE, N3::Terminals::ECHAR, N3::Terminals::ESCAPE_CHAR4, N3::Terminals::ESCAPE_CHAR8, N3::Terminals::EXPONENT, N3::Terminals::FORALL, N3::Terminals::INTEGER, N3::Terminals::IRIREF, N3::Terminals::IRI_RANGE, N3::Terminals::LANGTAG, N3::Terminals::PERCENT, N3::Terminals::PLX, N3::Terminals::PNAME_LN, N3::Terminals::PNAME_NS, N3::Terminals::PN_CHARS, N3::Terminals::PN_CHARS_BASE, N3::Terminals::PN_CHARS_BODY, N3::Terminals::PN_CHARS_U, N3::Terminals::PN_LOCAL, N3::Terminals::PN_LOCAL_BODY, N3::Terminals::PN_LOCAL_ESC, N3::Terminals::PN_PREFIX, N3::Terminals::PREFIX, N3::Terminals::QUICK_VAR_NAME, N3::Terminals::STRING_LITERAL_LONG_QUOTE, N3::Terminals::STRING_LITERAL_LONG_SINGLE_QUOTE, N3::Terminals::STRING_LITERAL_QUOTE, N3::Terminals::STRING_LITERAL_SINGLE_QUOTE, N3::Terminals::UCHAR, N3::Terminals::U_CHARS1, N3::Terminals::U_CHARS2, N3::Terminals::WS

Instance Attribute Summary

Attributes inherited from RDF::Literal

#datatype, #language

Instance Method Summary collapse

Methods inherited from Integer

#abs, #canonicalize!, #even?, #initialize, #nonzero?, #odd?, #pred, #round, #succ, #to_bn, #to_s, #zero?

Methods inherited from Decimal

#abs, #canonicalize!, #ceil, #floor, #initialize, #nonzero?, #round, #to_s, #zero?

Methods inherited from Numeric

#%, #*, #**, #+, #+@, #-, #-@, #/, #<=>, #==, #abs, #ceil, #floor, #round, #to_d, #to_f, #to_i, #to_r

Methods inherited from RDF::Literal

#==, #as_datetime, #as_number, #canonicalize!, #compatible?, #comperable_datatype?, #eql?, #escape, #has_datatype?, #has_language?, #hash, #humanize, #initialize, #inspect, #literal?, #method_missing, #object, #plain?, #respond_to_missing?, #simple?, #squish, #squish!, #to_s, #valid_extended?, #validate!, #value, #value_hash

Methods included from Term

#<=>, #==, #aggregate?, #as_datetime, #as_number, #compatible?, #eql?, #escape, #evaluate, #ndvars, #optimize, #sameTerm?, #term?, #to_base, #to_term, #vars

Methods included from SPARQL::Algebra::Expression

cast, #constant?, #evaluate, extension, extensions, for, #invalid?, new, #node?, open, #optimize, #optimize!, parse, register_extension, #to_sxp_bin, #validate!, #variable?

Methods included from Value

#anonymous?, #canonicalize, #canonicalize!, #constant?, #formula?, #graph?, #inspect, #inspect!, #invalid?, #iri?, #list?, #literal?, #node?, #resource?, #start_with?, #statement?, #term?, #to_ndvar, #to_nquads, #to_ntriples, #to_rdf, #to_term, #type_error, #uri?, #validate!, #variable?

Constructor Details

This class inherits a constructor from RDF::Literal::Integer

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RDF::Literal

Instance Method Details

#valid?Boolean

Returns:



90
91
92
# File 'vendor/bundler/ruby/2.7.0/bundler/gems/rdf-xsd-a2d77e29e739/lib/rdf/xsd/integer.rb', line 90

def valid?
  super && @object >= -32768 && @object <= 32767
end