class SPARQL::Algebra::Operator::Ceil

The SPARQL logical `ceil` operator.

@example

(ceil ?x)

@see www.w3.org/TR/sparql11-query/#func-ceil @see www.w3.org/TR/xpath-functions/#func-ceil

Constants

NAME

Public Instance Methods

apply(operand, **options) click to toggle source

Returns the smallest (closest to negative infinity) number with no fractional part that is not less than the value of `arg`. An error is raised if `arg` is not a numeric value.

@param [RDF::Literal] operand

the operand

@return [RDF::Literal] literal of same type @raise [TypeError] if the operand is not a numeric value

# File lib/sparql/algebra/operator/ceil.rb, line 23
def apply(operand, **options)
  case operand
    when RDF::Literal::Numeric then operand.ceil
    else raise TypeError, "expected an RDF::Literal::Numeric, but got #{operand.inspect}"
  end
end