Module: CarefulArray

Defined in:
lib/base/code_issue.rb

Instance Method Summary collapse

Instance Method Details

#carefully_remove(elements) ⇒ Object



14
15
16
17
18
# File 'lib/base/code_issue.rb', line 14

def carefully_remove(elements)
  missing_elements = elements - self
  raise "Cannot delete missing elements: #{missing_elements.inspect}" unless missing_elements.empty?
  (self - elements).extend(CarefulArray)
end