Joined October 2018
·

dalezak

mobile software developer
·
Saskatoon, SK
·
·
·

Posted to Ruby Array.except over 1 year ago

Nice snippet! I made a slight change to accept single or array parameters:
class Array def except(value) self - [value].flatten end end
So now it works for single
[1,2,3].exclude(2)
And also works for multiple
[1,2,3].exclude([1,3])

Achievements
1 Karma
0 Total ProTip Views
Interests & Skills