Class: Cyrel::AST::WithNode

Inherits:
ClauseNode show all
Defined in:
lib/cyrel/ast/with_node.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#==, #accept

Constructor Details

#initialize(items, distinct: false, where_conditions: nil) ⇒ WithNode

Returns a new instance of WithNode.



8
9
10
11
12
13
14
# File 'lib/cyrel/ast/with_node.rb', line 8

def initialize(items, distinct: false, where_conditions: nil)
  # items is an array of expressions/identifiers to project
  @items = items
  @distinct = distinct
  # where_conditions can be nil or an array of expressions
  @where_conditions = where_conditions
end

Instance Attribute Details

#distinctObject (readonly)

Returns the value of attribute distinct.



6
7
8
# File 'lib/cyrel/ast/with_node.rb', line 6

def distinct
  @distinct
end

#itemsObject (readonly)

Returns the value of attribute items.



6
7
8
# File 'lib/cyrel/ast/with_node.rb', line 6

def items
  @items
end

#where_conditionsObject (readonly)

Returns the value of attribute where_conditions.



6
7
8
# File 'lib/cyrel/ast/with_node.rb', line 6

def where_conditions
  @where_conditions
end