1. 2
  1.  

  2. 1

    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.