Class: Arel::Nodes::DoUpdateSet

Inherits:
OnConflictAction show all
Defined in:
lib/active_record_upsert/arel/nodes/do_update_set.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDoUpdateSet

Returns a new instance of DoUpdateSet.



7
8
9
10
11
# File 'lib/active_record_upsert/arel/nodes/do_update_set.rb', line 7

def initialize
  @wheres   = []
  @values   = []
  @key      = nil
end

Instance Attribute Details

#keyObject

Returns the value of attribute key.



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

def key
  @key
end

#valuesObject

Returns the value of attribute values.



4
5
6
# File 'lib/active_record_upsert/arel/nodes/do_update_set.rb', line 4

def values
  @values
end

#wheresObject

Returns the value of attribute wheres.



4
5
6
# File 'lib/active_record_upsert/arel/nodes/do_update_set.rb', line 4

def wheres
  @wheres
end

Instance Method Details

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

Returns:

  • (Boolean)


23
24
25
26
27
28
29
# File 'lib/active_record_upsert/arel/nodes/do_update_set.rb', line 23

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

#hashObject



19
20
21
# File 'lib/active_record_upsert/arel/nodes/do_update_set.rb', line 19

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

#initialize_copy(other) ⇒ Object



13
14
15
16
17
# File 'lib/active_record_upsert/arel/nodes/do_update_set.rb', line 13

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