Class: Seaquel::AST::TableAlias
- Inherits:
-
Object
- Object
- Seaquel::AST::TableAlias
- Defined in:
- lib/seaquel/ast/table_alias.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#table ⇒ Object
readonly
Returns the value of attribute table.
Instance Method Summary collapse
- #[](col_name) ⇒ Object
- #as_column_prefix(quoter) ⇒ Object
-
#initialize(table, name) ⇒ TableAlias
constructor
A new instance of TableAlias.
- #visit(visitor) ⇒ Object
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
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/seaquel/ast/table_alias.rb', line 5 def name @name end |
#table ⇒ Object (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 |