Class: ShEx::Algebra::Operator::Binary Abstract

Inherits:
ShEx::Algebra::Operator show all
Defined in:
lib/shex/algebra/operator.rb

Overview

This class is abstract.

A binary operator.

Operators of this kind take two operands.

Direct Known Subclasses

Base, Prefix, StemRange

Constant Summary collapse

ARITY =
2

Instance Attribute Summary

Attributes inherited from ShEx::Algebra::Operator

#operands, #options, #schema

Instance Method Summary collapse

Methods inherited from ShEx::Algebra::Operator

#closed?, #each_descendant, #eql?, #first_ancestor, #inspect, #not_matched, #not_satisfied, #operand, #parent, #parent=, #satisfiable?, #semact?, #semantic_actions, #status, #structure_error, #to_sxp, #to_sxp_bin, #triple_expression?, #validate!

Constructor Details

#initialize(arg1, arg2, options = {}) ⇒ Binary

Returns a new instance of Binary.

Parameters:

  • arg1 (RDF::Term)

    the first operand

  • arg2 (RDF::Term)

    the second operand

  • options (Hash{Symbol => Object}) (defaults to: {})

    any additional options (see ShEx::Algebra::Operator#initialize)

Raises:

  • (ArgumentError)


268
269
270
271
# File 'lib/shex/algebra/operator.rb', line 268

def initialize(arg1, arg2, options = {})
  raise ArgumentError, "wrong number of arguments (given 3, expected 2)" unless options.is_a?(Hash)
  super
end