Sep21
Alias include? with match operator
Often I need to test some variable against 2 or 3 values. The standard way to do it in most languages is:
This can get ugly if you start using more than 2 conditions (even if it is still a small number such as 3 or 4). Also sometimes your variable is not a variable but a chain of method calls that you don’t want to evaluate every time. For example:….
Continue reading »