Class: Seaquel::AST::JoinOp

Inherits:
Object
  • Object
show all
Defined in:
lib/seaquel/ast/join_op.rb

Overview

A binary operation that can be used to join things together, like ‘AND’ or ‘OR’.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(op, elements = []) ⇒ JoinOp

Returns a new instance of JoinOp.



9
10
11
# File 'lib/seaquel/ast/join_op.rb', line 9

def initialize op, elements=[]
  @op, @elements = op, elements
end

Instance Attribute Details

#elementsObject (readonly)

Returns the value of attribute elements.



7
8
9
# File 'lib/seaquel/ast/join_op.rb', line 7

def elements
  @elements
end

#opObject (readonly)

Returns the value of attribute op.



6
7
8
# File 'lib/seaquel/ast/join_op.rb', line 6

def op
  @op
end

Instance Method Details

#concat(element) ⇒ Object



13
14
15
# File 'lib/seaquel/ast/join_op.rb', line 13

def concat element
  elements << element
end

#empty?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/seaquel/ast/join_op.rb', line 17

def empty?
  elements.empty?
end

#inspectObject



25
26
27
# File 'lib/seaquel/ast/join_op.rb', line 25

def inspect
  [:join_op, op, *elements].inspect
end

#visit(visitor) ⇒ Object



21
22
23
# File 'lib/seaquel/ast/join_op.rb', line 21

def visit visitor
  visitor.visit_joinop(op, elements)
end