Class: Seaquel::AST::JoinOp
- Inherits:
-
Object
- Object
- Seaquel::AST::JoinOp
- 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
-
#elements ⇒ Object
readonly
Returns the value of attribute elements.
-
#op ⇒ Object
readonly
Returns the value of attribute op.
Instance Method Summary collapse
- #concat(element) ⇒ Object
- #empty? ⇒ Boolean
-
#initialize(op, elements = []) ⇒ JoinOp
constructor
A new instance of JoinOp.
- #inspect ⇒ Object
- #visit(visitor) ⇒ Object
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
#elements ⇒ Object (readonly)
Returns the value of attribute elements.
7 8 9 |
# File 'lib/seaquel/ast/join_op.rb', line 7 def elements @elements end |
#op ⇒ Object (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
17 18 19 |
# File 'lib/seaquel/ast/join_op.rb', line 17 def empty? elements.empty? end |
#inspect ⇒ Object
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 |