Sha256: 0a7c48aa3b9045ff7b4b649c66dc59568dc9cb55b429417cca8ce6d166dc6d77

Contents?: true

Size: 617 Bytes

Versions: 4

Compression:

Stored size: 617 Bytes

Contents

module Arel
  class TreeManager
    include Arel::FactoryMethods

    attr_reader :ast, :engine

    attr_accessor :bind_values

    def initialize engine
      @engine = engine
      @ctx    = nil
      @bind_values = []
    end

    def to_dot
      Visitors::Dot.new.accept @ast
    end

    def visitor
      engine.connection.visitor
    end

    def to_sql
      visitor.accept @ast
    end

    def initialize_copy other
      super
      @ast = @ast.clone
    end

    def where expr
      if Arel::TreeManager === expr
        expr = expr.ast
      end
      @ctx.wheres << expr
      self
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
angular-rails4-templates-0.4.1 vendor/ruby/2.1.0/gems/arel-5.0.1.20140414130214/lib/arel/tree_manager.rb
angular-rails4-templates-0.4.0 vendor/ruby/2.1.0/gems/arel-5.0.1.20140414130214/lib/arel/tree_manager.rb
angular-rails4-templates-0.3.0 vendor/ruby/2.1.0/gems/arel-5.0.1.20140414130214/lib/arel/tree_manager.rb
arel-5.0.1.20140414130214 lib/arel/tree_manager.rb