Method: Enumerable#difference

Defined in:
lib/jinx/helpers/enumerable.rb

#difference(other) ⇒ Object Also known as: -

Returns an Enumerable which iterates over items in this Enumerable but not the other Enumerable.

Returns:

  • an Enumerable which iterates over items in this Enumerable but not the other Enumerable



182
183
184
# File 'lib/jinx/helpers/enumerable.rb', line 182

def difference(other)
  filter { |item| not other.include?(item) }
end