Created
May 4, 2011 22:16
-
-
Save nzifnab/956156 to your computer and use it in GitHub Desktop.
update_amount method
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
def update_amount(amt, change_type) | |
if change_type == 'Withdraw' | |
self.amount -= amt | |
elsif change_type == 'Deposit' | |
self.amount += amt | |
else | |
raise ArgumentError.new("Unknown type #{change_type} when altering account funds.") | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment