Class: Hecks::Adapters::SQLDatabase::Commands::Update::DeleteReferences

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(table:, attributes:, reference:) ⇒ DeleteReferences

Returns a new instance of DeleteReferences.



9
10
11
12
13
14
15
# File 'lib/commands/update/delete_references.rb', line 9

def initialize(table:, attributes:, reference:)
  @table = table
  @attributes = attributes
  @reference = reference
  @where_clause = {}
  @dataset = DB[JoinTable.new(@table, @reference).name.to_sym]
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



7
8
9
# File 'lib/commands/update/delete_references.rb', line 7

def attributes
  @attributes
end

Instance Method Details

#callObject



17
18
19
20
21
22
# File 'lib/commands/update/delete_references.rb', line 17

def call
  # build_where_clause
  delete_references
  remove_references_from_attributes
  self
end