Class: Seaquel::AST::TableAlias

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(table, name) ⇒ TableAlias

Returns a new instance of TableAlias.



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

def initialize table, name
  @table = table
  @name = name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/seaquel/ast/table_alias.rb', line 5

def name
  @name
end

#tableObject (readonly)

Returns the value of attribute table.



4
5
6
# File 'lib/seaquel/ast/table_alias.rb', line 4

def table
  @table
end

Instance Method Details

#[](col_name) ⇒ Object



12
13
14
# File 'lib/seaquel/ast/table_alias.rb', line 12

def [] col_name
  Column.new(col_name, self)
end

#as_column_prefix(quoter) ⇒ Object



20
21
22
# File 'lib/seaquel/ast/table_alias.rb', line 20

def as_column_prefix quoter
  quoter.identifier(name)
end

#visit(visitor) ⇒ Object



16
17
18
# File 'lib/seaquel/ast/table_alias.rb', line 16

def visit visitor
  visitor.visit_table_alias table, name
end