Class: SqlTools::CommonTableExpression

Inherits:
Object
  • Object
show all
Defined in:
lib/sql_tools/common_table_expression.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(node) ⇒ CommonTableExpression

Returns a new instance of CommonTableExpression.



5
6
7
# File 'lib/sql_tools/common_table_expression.rb', line 5

def initialize(node)
  @node = node
end

Instance Attribute Details

#nodeObject (readonly)

Returns the value of attribute node.



3
4
5
# File 'lib/sql_tools/common_table_expression.rb', line 3

def node
  @node
end

Instance Method Details

#inspectObject



15
# File 'lib/sql_tools/common_table_expression.rb', line 15

def inspect = "#<class CommonTableExpression name=#{name.inspect}>"

#nameObject



9
# File 'lib/sql_tools/common_table_expression.rb', line 9

def name = node.children.first.text.delete('`')

#viewObject



11
12
13
# File 'lib/sql_tools/common_table_expression.rb', line 11

def view
  @view ||= ViewVisitor.new(node.children[-2]).visit.view
end