Building a hash in a conditional way
I prefer tap, as I think it provides a cleaner solution than the ones described here by not requiring any hacky deleting of elements and by clearly defining the scope in which the hash is being built. It also means you don’t need to declare an unnecessary local variable, which I always hate. In case … Read more