Class: RDF::N3::Algebra::Math::ACosH
- Inherits:
-
ResourceOperator
- Object
- SPARQL::Algebra::Operator::Binary
- ResourceOperator
- RDF::N3::Algebra::Math::ACosH
- Defined in:
- lib/rdf/n3/algebra/math/acosh.rb
Overview
The object is calulated as the inverse hyperbolic cosine value of the subject.
Constant Summary collapse
Instance Attribute Summary
Attributes included from Enumerable
Instance Method Summary collapse
-
#resolve(resource, position:) ⇒ RDF::Term
The math:acosh operator takes string or number and calculates its inverse hyperbolic cosine.
Methods inherited from ResourceOperator
#as_literal, #execute, #input_operand, #valid?
Methods included from Builtin
#each, #evaluate, #hash, #input_operand, #rank, #to_uri
Instance Method Details
#resolve(resource, position:) ⇒ RDF::Term
The math:acosh operator takes string or number and calculates its inverse hyperbolic cosine.
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/rdf/n3/algebra/math/acosh.rb', line 15 def resolve(resource, position:) case position when :subject return nil unless resource.literal? as_literal(Math.acosh(resource.as_number.object)) when :object return nil unless resource.literal? || resource.variable? resource end end |