I'd switch this to a case statement for readabilities sake.

I would also suggest raising an actual error, like `ArgumentError`.