Module: CarefulArray

Defined in:
lib/base/code_issue.rb

Instance Method Summary collapse

Instance Method Details

#carefully_remove(elements) ⇒ Object



11
12
13
14
15
# File 'lib/base/code_issue.rb', line 11

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