Class: Seaquel::AST::JoinOp
- Inherits:
-
Expression
- Object
- Expression
- Seaquel::AST::JoinOp
- Extended by:
- Forwardable
- 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(*more) ⇒ Object
- #empty? ⇒ Boolean
-
#initialize(op, elements = []) ⇒ JoinOp
constructor
A new instance of JoinOp.
- #inspect ⇒ Object
- #visit(visitor) ⇒ Object
Methods inherited from Expression
#as, #asc, binop, #desc, joinop, #lisp_inspect, unaryop
Constructor Details
#initialize(op, elements = []) ⇒ JoinOp
Returns a new instance of JoinOp.
14 15 16 |
# File 'lib/seaquel/ast/join_op.rb', line 14 def initialize op, elements=[] @op, @elements = op, elements end |
Instance Attribute Details
#elements ⇒ Object (readonly)
Returns the value of attribute elements.
12 13 14 |
# File 'lib/seaquel/ast/join_op.rb', line 12 def elements @elements end |
#op ⇒ Object (readonly)
Returns the value of attribute op.
11 12 13 |
# File 'lib/seaquel/ast/join_op.rb', line 11 def op @op end |
Instance Method Details
#concat(*more) ⇒ Object
18 19 20 21 22 |
# File 'lib/seaquel/ast/join_op.rb', line 18 def concat *more more.each do |el| elements << el end end |
#empty? ⇒ Boolean
24 25 26 |
# File 'lib/seaquel/ast/join_op.rb', line 24 def empty? elements.empty? end |
#inspect ⇒ Object
32 33 34 |
# File 'lib/seaquel/ast/join_op.rb', line 32 def inspect lisp_inspect(:join_op, op, elements) end |
#visit(visitor) ⇒ Object
28 29 30 |
# File 'lib/seaquel/ast/join_op.rb', line 28 def visit visitor visitor.visit_joinop(op, elements) end |