Class: Axiom::Adapter::Arango::Visitor::Binary

Inherits:
Axiom::Adapter::Arango::Visitor show all
Defined in:
lib/axiom/adapter/arango/visitor/binary.rb

Overview

Visitor for binary AQL nodes

Constant Summary collapse

MAPPING =
{
  Function::Numeric::Multiplication         => AQL::Node::Operator::Binary::Multiplication,
  Function::Numeric::Addition               => AQL::Node::Operator::Binary::Addition,
  Function::Numeric::Division               => AQL::Node::Operator::Binary::Division,
  Function::Numeric::Modulo                 => AQL::Node::Operator::Binary::Modulo,
  Function::Numeric::Subtraction            => AQL::Node::Operator::Binary::Subtraction,
  Function::Predicate::GreaterThanOrEqualTo => AQL::Node::Operator::Binary::GreaterThanOrEqualTo,
  Function::Predicate::GreaterThan          => AQL::Node::Operator::Binary::GreaterThan,
  Function::Predicate::LessThan             => AQL::Node::Operator::Binary::LessThan,
  Function::Predicate::LessThanOrEqualTo    => AQL::Node::Operator::Binary::LessThanOrEqualTo,
  Function::Connective::Disjunction         => AQL::Node::Operator::Binary::Or,
  Function::Connective::Conjunction         => AQL::Node::Operator::Binary::And,
  Function::Predicate::Equality             => AQL::Node::Operator::Binary::Equality,
  Function::Predicate::Inequality           => AQL::Node::Operator::Binary::Inequality
}.freeze

Constants inherited from Axiom::Adapter::Arango::Visitor

REGISTRY

Instance Method Summary collapse

Methods inherited from Axiom::Adapter::Arango::Visitor

build, run

Instance Method Details

#local_nameNode::Name

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Return local name

Returns:

  • (Node::Name)


34
35
36
# File 'lib/axiom/adapter/arango/visitor/binary.rb', line 34

def local_name
  context.local_name
end

#rootAQL::Node

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Return root AQL node

Returns:

  • (AQL::Node)


45
46
47
48
# File 'lib/axiom/adapter/arango/visitor/binary.rb', line 45

def root
  klass = MAPPING.fetch(input.class)
  klass.new(left, right)
end