Class: Arel::Nodes::DeleteStatement

Inherits:
Node show all
Defined in:
activerecord/lib/arel/nodes/delete_statement.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#and, #not, #or, #to_sql

Methods included from FactoryMethods

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

Constructor Details

#initialize(relation = nil, wheres = []) ⇒ DeleteStatement

Returns a new instance of DeleteStatement.



13
14
15
16
17
18
19
20
21
# File 'activerecord/lib/arel/nodes/delete_statement.rb', line 13

def initialize(relation = nil, wheres = [])
  super()
  @left = relation
  @right = wheres
  @orders = []
  @limit = nil
  @offset = nil
  @key = nil
end

Instance Attribute Details

#keyObject

Returns the value of attribute key



6
7
8
# File 'activerecord/lib/arel/nodes/delete_statement.rb', line 6

def key
  @key
end

#leftObject Also known as: relation

Returns the value of attribute left



6
7
8
# File 'activerecord/lib/arel/nodes/delete_statement.rb', line 6

def left
  @left
end

#limitObject

Returns the value of attribute limit



6
7
8
# File 'activerecord/lib/arel/nodes/delete_statement.rb', line 6

def limit
  @limit
end

#offsetObject

Returns the value of attribute offset



6
7
8
# File 'activerecord/lib/arel/nodes/delete_statement.rb', line 6

def offset
  @offset
end

#ordersObject

Returns the value of attribute orders



6
7
8
# File 'activerecord/lib/arel/nodes/delete_statement.rb', line 6

def orders
  @orders
end

#rightObject Also known as: wheres

Returns the value of attribute right



6
7
8
# File 'activerecord/lib/arel/nodes/delete_statement.rb', line 6

def right
  @right
end

Instance Method Details

#eql?(other) ⇒ Boolean Also known as: ==

Returns:

  • (Boolean)


33
34
35
36
37
38
39
40
41
# File 'activerecord/lib/arel/nodes/delete_statement.rb', line 33

def eql?(other)
  self.class == other.class &&
    self.left == other.left &&
    self.right == other.right &&
    self.orders == other.orders &&
    self.limit == other.limit &&
    self.offset == other.offset &&
    self.key == other.key
end

#hashObject



29
30
31
# File 'activerecord/lib/arel/nodes/delete_statement.rb', line 29

def hash
  [self.class, @left, @right, @orders, @limit, @offset, @key].hash
end

#initialize_copy(other) ⇒ Object



23
24
25
26
27
# File 'activerecord/lib/arel/nodes/delete_statement.rb', line 23

def initialize_copy(other)
  super
  @left  = @left.clone if @left
  @right = @right.clone if @right
end