But… why not just pass a lambda with a pattern match and call it a day? I know ruby doesn’t have pattern matching but a switch statement can be used with the .class method and its way less code.
.class
But… why not just pass a lambda with a pattern match and call it a day? I know ruby doesn’t have pattern matching but a switch statement can be used with the
.classmethod and its way less code.