Class: Arel::Nodes::UpdateStatement

Inherits:
Node
  • Object
show all
Defined in:
lib/arel/nodes/update_statement.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#and, #equality?, #fetch_attribute, #invert, #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) ⇒ UpdateStatement

Returns a new instance of UpdateStatement.



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/arel/nodes/update_statement.rb', line 8

def initialize(relation = nil)
  super()
  @relation = relation
  @wheres   = []
  @values   = []
  @groups   = []
  @havings  = []
  @orders   = []
  @limit    = nil
  @offset   = nil
  @key      = nil
end

Instance Attribute Details

#groupsObject

Returns the value of attribute groups.



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

def groups
  @groups
end

#havingsObject

Returns the value of attribute havings.



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

def havings
  @havings
end

#keyObject

Returns the value of attribute key.



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

def key
  @key
end

#limitObject

Returns the value of attribute limit.



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

def limit
  @limit
end

#offsetObject

Returns the value of attribute offset.



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

def offset
  @offset
end

#ordersObject

Returns the value of attribute orders.



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

def orders
  @orders
end

#relationObject

Returns the value of attribute relation.



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

def relation
  @relation
end

#valuesObject

Returns the value of attribute values.



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

def values
  @values
end

#wheresObject

Returns the value of attribute wheres.



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

def wheres
  @wheres
end

Instance Method Details

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

Returns:

  • (Boolean)


31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/arel/nodes/update_statement.rb', line 31

def eql?(other)
  self.class == other.class &&
    self.relation == other.relation &&
    self.wheres == other.wheres &&
    self.values == other.values &&
    self.groups == other.groups &&
    self.havings == other.havings &&
    self.orders == other.orders &&
    self.limit == other.limit &&
    self.offset == other.offset &&
    self.key == other.key
end

#hashObject



27
28
29
# File 'lib/arel/nodes/update_statement.rb', line 27

def hash
  [@relation, @wheres, @values, @orders, @limit, @offset, @key].hash
end

#initialize_copy(other) ⇒ Object



21
22
23
24
25
# File 'lib/arel/nodes/update_statement.rb', line 21

def initialize_copy(other)
  super
  @wheres = @wheres.clone
  @values = @values.clone
end