class RDF::N3::Algebra::Math::Floor
The object is calculated as the subject downwards to a whole number.
Constants
- NAME
- URI
Public Instance Methods
Source
# File lib/rdf/n3/algebra/math/floor.rb, line 17 def resolve(resource, position:) case position when :subject return nil unless resource.literal? RDF::Literal(resource.as_number.floor) when :object return nil unless resource.literal? || resource.variable? resource end end
The math:floor operator takes string or number and calculates its floor.
@param [RDF::Term] resource @param [:subject, :object] position @return [RDF::Term] @see RDF::N3::ResourceOperator#evaluate