Created
October 20, 2013 15:11
-
-
Save ascendbruce/7070884 to your computer and use it in GitHub Desktop.
Ruby throw catch example
This file contains 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
error = catch(:error) do | |
throw :error, "params uuid required" if uuid.blank? | |
throw :error, "params lang required" unless params.include?("lang") | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment