Class: Arel::DeleteManager

Inherits:
TreeManager show all
Defined in:
lib/arel/delete_manager.rb

Instance Attribute Summary

Attributes inherited from TreeManager

#ast

Instance Method Summary collapse

Methods inherited from TreeManager

#initialize_copy, #to_dot, #to_sql, #where

Methods included from FactoryMethods

#create_and, #create_false, #create_join, #create_on, #create_string_join, #create_table_alias, #create_true, #grouping, #lower

Constructor Details

#initializeDeleteManager

Returns a new instance of DeleteManager.



4
5
6
7
8
# File 'lib/arel/delete_manager.rb', line 4

def initialize
  super
  @ast = Nodes::DeleteStatement.new
  @ctx = @ast
end

Instance Method Details

#from(relation) ⇒ Object



10
11
12
13
# File 'lib/arel/delete_manager.rb', line 10

def from relation
  @ast.relation = relation
  self
end

#take(limit) ⇒ Object



15
16
17
18
# File 'lib/arel/delete_manager.rb', line 15

def take limit
  @ast.limit = Nodes::Limit.new(Nodes.build_quoted(limit)) if limit
  self
end

#wheres=(list) ⇒ Object



20
21
22
# File 'lib/arel/delete_manager.rb', line 20

def wheres= list
  @ast.wheres = list
end