I wanted to do a quick post on a new method added to ruby Array class in version 2.6. I just learned about this over the past weekend. This will quickly grow to be a favorite of mine.
A method to check differences in values between two arrays.
In versions prior, I would make a .difference method in my .pryrc file and that will be loaded at runtime when I run my console. You can also monkey patch it live in a pry console. Found this via stackedoverflow post. Here is how I would add it in a running pry session:
But now in ruby 2.6+, you can just use the .difference method. It is built into the class now.
So nice, so easy!