Class: Hecks::Adapters::SQLDatabase::Commands::Update::UpdateValues

Inherits:
Object
  • Object
show all
Defined in:
lib/commands/update/update_values.rb

Instance Method Summary collapse

Constructor Details

#initialize(references, attributes, table, id) ⇒ UpdateValues

Returns a new instance of UpdateValues.



7
8
9
10
11
12
13
# File 'lib/commands/update/update_values.rb', line 7

def initialize(references, attributes, table, id)
  @references = references
  @attributes = attributes
  @reference_ids = {}
  @table = table
  @id = id
end

Instance Method Details

#callObject



15
16
17
18
19
20
21
# File 'lib/commands/update/update_values.rb', line 15

def call
  @references.each do |reference|
    create_new_value(reference)
    delete_old_references(reference)
    link_to_new_values(reference)
  end
end