Class: Arel::TreeManager
Instance Attribute Summary collapse
Instance Method Summary
collapse
#create_and, #create_false, #create_join, #create_on, #create_string_join, #create_table_alias, #create_true, #grouping, #lower
Constructor Details
Returns a new instance of TreeManager.
7
8
9
10
|
# File 'lib/arel/tree_manager.rb', line 7
def initialize engine
@engine = engine
@ctx = nil
end
|
Instance Attribute Details
#ast ⇒ Object
Returns the value of attribute ast.
5
6
7
|
# File 'lib/arel/tree_manager.rb', line 5
def ast
@ast
end
|
#engine ⇒ Object
Returns the value of attribute engine.
5
6
7
|
# File 'lib/arel/tree_manager.rb', line 5
def engine
@engine
end
|
Instance Method Details
#initialize_copy(other) ⇒ Object
24
25
26
27
|
# File 'lib/arel/tree_manager.rb', line 24
def initialize_copy other
super
@ast = @ast.clone
end
|
#to_sql ⇒ Object
20
21
22
|
# File 'lib/arel/tree_manager.rb', line 20
def to_sql
visitor.accept @ast
end
|
#visitor ⇒ Object
16
17
18
|
# File 'lib/arel/tree_manager.rb', line 16
def visitor
engine.connection.visitor
end
|
#where(expr) ⇒ Object
29
30
31
32
33
34
35
|
# File 'lib/arel/tree_manager.rb', line 29
def where expr
if Arel::TreeManager === expr
expr = expr.ast
end
@ctx.wheres << expr
self
end
|