Class: Archsight::Query::AST::BinaryOp

Inherits:
Node
  • Object
show all
Defined in:
lib/archsight/query/ast.rb

Overview

Binary logical operation (AND, OR)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(operator, left, right) ⇒ BinaryOp

Returns a new instance of BinaryOp.



30
31
32
33
34
# File 'lib/archsight/query/ast.rb', line 30

def initialize(operator, left, right)
  @operator = operator # :and, :or
  @left = left
  @right = right
end

Instance Attribute Details

#leftObject (readonly)

Returns the value of attribute left.



28
29
30
# File 'lib/archsight/query/ast.rb', line 28

def left
  @left
end

#operatorObject (readonly)

Returns the value of attribute operator.



28
29
30
# File 'lib/archsight/query/ast.rb', line 28

def operator
  @operator
end

#rightObject (readonly)

Returns the value of attribute right.



28
29
30
# File 'lib/archsight/query/ast.rb', line 28

def right
  @right
end

Instance Method Details

#accept(visitor) ⇒ Object



36
37
38
# File 'lib/archsight/query/ast.rb', line 36

def accept(visitor)
  visitor.visit_binary_op(self)
end