Created
July 27, 2011 17:48
-
-
Save achambers/1109964 to your computer and use it in GitHub Desktop.
insufficient_funds_ruby
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 withdraw account_number, withdrawal_amount do | |
| account = Account.find account_number | |
| unless account.sufficient_funds? withdrawal_amount do | |
| raise "Insufficient funds" | |
| end | |
| #...more code... | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment