Module: Holistic::Ruby::Reference::Delete

Extended by:
Delete
Included in:
Delete
Defined in:
lib/holistic/ruby/reference/delete.rb

Instance Method Summary collapse

Instance Method Details

#call(database:, reference:) ⇒ Object



7
8
9
10
11
12
13
14
15
16
# File 'lib/holistic/ruby/reference/delete.rb', line 7

def call(database:, reference:)
  database.delete(reference.identifier)

  reference.relation(:reference_defined_in_file).delete!(reference.location.file)
  reference.relation(:located_in_scope).delete!(reference.located_in_scope)

  if reference.referenced_scope
    reference.relation(:referenced_scope).delete!(reference.referenced_scope)
  end
end