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

#_caller, #and, #each, #not, #or, #to_sql

Methods included from FactoryMethods

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

Constructor Details

#initializeUpdateStatement

Returns a new instance of UpdateStatement.



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

def initialize
  @relation = nil
  @wheres   = []
  @values   = []
  @orders   = []
  @limit    = nil
  @key      = nil
end

Instance Attribute Details

#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.



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

def limit
  @limit
end

#ordersObject

Returns the value of attribute orders.



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

def orders
  @orders
end

#relationObject

Returns the value of attribute relation.



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

def relation
  @relation
end

#valuesObject

Returns the value of attribute values.



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

def values
  @values
end

#wheresObject

Returns the value of attribute wheres.



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

def wheres
  @wheres
end

Instance Method Details

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

Returns:

  • (Boolean)


27
28
29
30
31
32
33
34
35
# File 'lib/arel/nodes/update_statement.rb', line 27

def eql? other
  self.class == other.class &&
    self.relation == other.relation &&
    self.wheres == other.wheres &&
    self.values == other.values &&
    self.orders == other.orders &&
    self.limit == other.limit &&
    self.key == other.key
end

#hashObject



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

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

#initialize_copy(other) ⇒ Object



17
18
19
20
21
# File 'lib/arel/nodes/update_statement.rb', line 17

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