Created
November 26, 2013 02:03
-
-
Save rubysolo/7652387 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Enumerable | |
def remove(other) | |
base = self.dup | |
other.each { |i| base.delete_at(base.index(i) || base.length) } | |
base | |
end | |
end | |
irb(main):008:0> [1,1,2,3].remove([1,2]) | |
=> [1, 3] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment