aboutsummaryrefslogblamecommitdiffstats
path: root/lib/arel/update_manager.rb
blob: f712103f9804ef5b77ec2d35363b58b42dc917ad (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14













                                         



                          



                          




                           

     
module Arel
  class UpdateManager < Arel::TreeManager
    def initialize engine
      super
      @head = Nodes::UpdateStatement.new
    end

    ###
    # UPDATE +table+
    def table table
      @head.relation = table
      self
    end

    def wheres= exprs
      @head.wheres = exprs
    end

    def where expr
      @head.wheres << expr
      self
    end

    def set values
      @head.values = values
      self
    end
  end
end