Same comment as above: 
Only two spaces need to be before def, and then two more spaces in the method itself. The def and the body of the method should not be on the same line.

Plus, the if statement should be aligned with the content of the method, then it's content indented two spaces, and the else if is aligned with the if like you did.