Module EasyDiff::Core
In: lib/easy_diff/core.rb

Methods

Public Class methods

Can‘t use regular empty? because that affects strings.

Non-destructive version of above method.

Regular array difference does not handle duplicate values in the way that is needed for this library. Examples:

  subtract_arrays([1, 1, 2, 3], [1, 2]) => [1, 3]
  subtract_arrays([3, 3, 3, 4], [3, 4, 5]) => [3, 3]

Shamelessly stolen from stackoverflow.com/questions/3852755/ruby-array-subtraction-without-removing-items-more-than-once

[Validate]