Class: Seaquel::AST::Table
- Inherits:
-
Expression
- Object
- Expression
- Seaquel::AST::Table
- Defined in:
- lib/seaquel/ast/table.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#[](col_name) ⇒ Object
Returns a table column.
-
#as(name) ⇒ Object
Returns a table alias.
-
#as_column_prefix(quoter) ⇒ Object
Returns the identifier that designates the table uniquely in the query as a prefix for column references.
-
#initialize(name) ⇒ Table
constructor
A new instance of Table.
- #inspect ⇒ Object
- #quote(quoter) ⇒ Object
- #visit(visitor) ⇒ Object
Methods inherited from Expression
#asc, binop, #desc, joinop, #lisp_inspect, unaryop
Constructor Details
#initialize(name) ⇒ Table
Returns a new instance of Table.
5 6 7 |
# File 'lib/seaquel/ast/table.rb', line 5 def initialize name @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/seaquel/ast/table.rb', line 3 def name @name end |
Instance Method Details
#[](col_name) ⇒ Object
Returns a table column.
19 20 21 |
# File 'lib/seaquel/ast/table.rb', line 19 def [] col_name Column.new(col_name, self) end |
#as(name) ⇒ Object
Returns a table alias.
25 26 27 |
# File 'lib/seaquel/ast/table.rb', line 25 def as name TableAlias.new(self, name) end |
#as_column_prefix(quoter) ⇒ Object
Returns the identifier that designates the table uniquely in the query as a prefix for column references. (“foo”.“a”)
32 33 34 |
# File 'lib/seaquel/ast/table.rb', line 32 def as_column_prefix quoter quote(quoter) end |
#inspect ⇒ Object
36 37 38 |
# File 'lib/seaquel/ast/table.rb', line 36 def inspect lisp_inspect(:table, name) end |
#quote(quoter) ⇒ Object
13 14 15 |
# File 'lib/seaquel/ast/table.rb', line 13 def quote quoter quoter.table(name) end |
#visit(visitor) ⇒ Object
9 10 11 |
# File 'lib/seaquel/ast/table.rb', line 9 def visit visitor visitor.visit_table(self) end |