Created
October 13, 2014 13:22
-
-
Save matstc/f27e3301e243c10fd8e9 to your computer and use it in GitHub Desktop.
Example of Not Using a Guard Clause
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def divide x, y | |
if y == 0 | |
raise "Cannot divide by zero" | |
else | |
x / y | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment