Forked from MichaelXavier/aborting_composed_method.rb
Last active
December 12, 2015 08:08
-
-
Save jakeonrails/4741395 to your computer and use it in GitHub Desktop.
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
# Assuming all the methods called here also return true/false, | |
# use the logical composition operators to create a final result | |
# which can short-circuit if one of the methods fails: | |
def composed_method | |
frobulate_widgets and refrobulate_widgets and confribulate_frobulations | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment