This one line is far too compact.  One-liners in general are hard to debug and step through, but this also has the problem of relying heavily on the precedence of method calling and trailing `if`.  It's also calling `n.to_i` twice, so it's saved lines of code (which isn't a real concern), but made the code less efficient during runtime.