Skip to content

Instantly share code, notes, and snippets.

@gdiggs
Created November 5, 2014 15:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gdiggs/686a17614737c9ebb9cb to your computer and use it in GitHub Desktop.
Save gdiggs/686a17614737c9ebb9cb to your computer and use it in GitHub Desktop.
Enumerable#without
module Enumerable
def without(value)
reject { |i| i == value }
end
end
# irb(main):006:0> [1,2,3].without(2)
# => [1, 3]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment