class Arel::TreeManager

Attributes

ast[R]
bind_values[RW]
engine[R]

Public Class Methods

new() click to toggle source
# File lib/arel/tree_manager.rb, line 11
def initialize
  @ctx    = nil
  @bind_values = []
end

Public Instance Methods

initialize_copy(other) click to toggle source
Calls superclass method
# File lib/arel/tree_manager.rb, line 28
def initialize_copy other
  super
  @ast = @ast.clone
end
to_dot() click to toggle source
# File lib/arel/tree_manager.rb, line 16
def to_dot
  collector = Arel::Collectors::PlainString.new
  collector = Visitors::Dot.new.accept @ast, collector
  collector.value
end
to_sql(engine = Table.engine) click to toggle source
# File lib/arel/tree_manager.rb, line 22
def to_sql engine = Table.engine
  collector = Arel::Collectors::SQLString.new
  collector = engine.connection.visitor.accept @ast, collector
  collector.value
end
where(expr) click to toggle source
# File lib/arel/tree_manager.rb, line 33
def where expr
  if Arel::TreeManager === expr
    expr = expr.ast
  end
  @ctx.wheres << expr
  self
end